Compiler version specific configuration support added

This commit is contained in:
Mateusz Pusz
2019-05-18 12:59:08 +02:00
parent 28277c56ed
commit c30673fb7e
6 changed files with 75 additions and 7 deletions
+10 -3
View File
@@ -29,10 +29,13 @@ project(units
)
# set path to custom cmake modules
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/common/cmake")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
# include common tools and workarounds
include(tools)
include(common/cmake/tools)
# check availability of C++20 features
include(check_features)
# library definition
add_library(units INTERFACE)
@@ -59,7 +62,7 @@ target_link_libraries(units
target_include_directories(units
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include>
)
add_library(mp::units ALIAS units)
@@ -75,6 +78,10 @@ install(DIRECTORY include/units
DESTINATION include
COMPONENT Devel
)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/units
DESTINATION include
COMPONENT Devel
)
# generate configuration files and install the package
configure_and_install(../cmake/common/cmake/simple_package-config.cmake.in mp SameMajorVersion)
+5
View File
@@ -22,10 +22,13 @@
#pragma once
#include <units/bits/config.h>
#include <experimental/ranges/concepts>
namespace std {
#ifndef UNITS_HAS_STD_TYPE_IDENTITY
// type_identity
template<typename T>
struct type_identity { using type = T; };
@@ -33,6 +36,8 @@ namespace std {
template<typename T>
using type_identity_t = typename type_identity<T>::type;
#endif // UNITS_HAS_STD_TYPE_IDENTITY
// concepts
using experimental::ranges::Same;
using experimental::ranges::Integral;