From 65860ad7d743cf41ee012bec0326e0fc8689ba8c Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Sun, 6 Oct 2024 08:06:38 +0200 Subject: [PATCH] build: setting of some test_package CMake options enabled only for a `cxx_modules` build --- test_package/conanfile.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test_package/conanfile.py b/test_package/conanfile.py index c66b1741..f81cf891 100644 --- a/test_package/conanfile.py +++ b/test_package/conanfile.py @@ -49,11 +49,12 @@ class TestPackageConan(ConanFile): "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: - tc.cache_variables["MP_UNITS_API_STD_FORMAT"] = opt.std_format - tc.cache_variables["MP_UNITS_API_CONTRACTS"] = str(opt.contracts).upper() + if opt.cxx_modules: + 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() def build(self):