mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-03 20:34:26 +02:00
build(conan): packaging improved
This commit is contained in:
@@ -27,12 +27,3 @@ find_package(mp-units REQUIRED)
|
||||
|
||||
add_executable(test_package test_package.cpp)
|
||||
target_link_libraries(test_package PRIVATE mp-units::mp-units)
|
||||
target_compile_definitions(test_package PRIVATE MP_UNITS_API_STD_FORMAT=$<BOOL:${MP_UNITS_API_STD_FORMAT}>)
|
||||
|
||||
if(MP_UNITS_API_CONTRACTS STREQUAL "NONE")
|
||||
target_compile_definitions(test_package PRIVATE MP_UNITS_API_CONTRACTS=0)
|
||||
elseif(MP_UNITS_API_CONTRACTS STREQUAL "GSL-LITE")
|
||||
target_compile_definitions(test_package PRIVATE MP_UNITS_API_CONTRACTS=2)
|
||||
elseif(MP_UNITS_API_CONTRACTS STREQUAL "MS-GSL")
|
||||
target_compile_definitions(test_package PRIVATE MP_UNITS_API_CONTRACTS=3)
|
||||
endif()
|
||||
|
@@ -42,13 +42,13 @@ class TestPackageConan(ConanFile):
|
||||
opt = self.dependencies["mp-units"].options
|
||||
if opt.cxx_modules:
|
||||
tc.cache_variables["CMAKE_CXX_SCAN_FOR_MODULES"] = True
|
||||
tc.cache_variables["MP_UNITS_BUILD_CXX_MODULES"] = True
|
||||
if opt.import_std:
|
||||
tc.cache_variables["CMAKE_CXX_MODULE_STD"] = True
|
||||
# Current experimental support according to `Help/dev/experimental.rst`
|
||||
tc.cache_variables[
|
||||
"CMAKE_EXPERIMENTAL_CXX_IMPORT_STD"
|
||||
] = "0e5b6991-d74f-4b3d-a41c-cf096e0b2508"
|
||||
# TODO remove the below when Conan will learn to handle C++ modules
|
||||
if opt.freestanding:
|
||||
tc.cache_variables["MP_UNITS_API_FREESTANDING"] = True
|
||||
else:
|
||||
|
Reference in New Issue
Block a user