mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-01 19:34:29 +02:00
build: generate()
in test_package
now correctly propagates project's options
This commit is contained in:
@@ -39,9 +39,22 @@ class TestPackageConan(ConanFile):
|
|||||||
|
|
||||||
def generate(self):
|
def generate(self):
|
||||||
tc = CMakeToolchain(self)
|
tc = CMakeToolchain(self)
|
||||||
tc.variables["MP_UNITS_API_STD_FORMAT"] = bool(
|
opt = self.dependencies["mp-units"].options
|
||||||
self.dependencies["mp-units"].options.std_format
|
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
|
||||||
|
tc.cache_variables["MP_UNITS_BUILD_IMPORT_STD"] = True
|
||||||
|
# Current experimental support according to `Help/dev/experimental.rst`
|
||||||
|
tc.cache_variables["CMAKE_EXPERIMENTAL_CXX_IMPORT_STD"] = (
|
||||||
|
"0e5b6991-d74f-4b3d-a41c-cf096e0b2508"
|
||||||
|
)
|
||||||
|
if opt.freestanding:
|
||||||
|
tc.cache_variables["MP_UNITS_API_FREESTANDING"] = True
|
||||||
|
else:
|
||||||
|
tc.cache_variables["MP_UNITS_API_STD_FORMAT"] = opt.std_format
|
||||||
|
tc.cache_variables["MP_UNITS_API_CONTRACTS"] = str(opt.contracts).upper()
|
||||||
tc.generate()
|
tc.generate()
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
|
Reference in New Issue
Block a user