Skip to content

Commit

Permalink
fix: test_package building fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mpusz committed Apr 17, 2024
1 parent 56be073 commit 437a9d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,7 @@ if(MP_UNITS_BUILD_CXX_MODULES)
add_executable(test_package test_package.cpp)
target_compile_features(test_package PRIVATE cxx_std_20)
target_link_libraries(test_package PRIVATE mp-units::mp-units)
target_compile_definitions(test_package PRIVATE MP_UNITS_MODULES MP_UNITS_API_STD_FORMAT=$<BOOL:${MP_UNITS_API_STD_FORMAT}>)
target_compile_definitions(
test_package PRIVATE MP_UNITS_MODULES MP_UNITS_API_STD_FORMAT=$<BOOL:${MP_UNITS_API_STD_FORMAT}>
)
endif()
7 changes: 4 additions & 3 deletions test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ def layout(self):
def generate(self):
tc = CMakeToolchain(self)
if self.dependencies["mp-units"].options.cxx_modules:
tc.variables["MP_UNITS_BUILD_CXX_MODULES"] = True
tc.variables["MP_UNITS_API_STD_FORMAT"] = bool(
tc.cache_variables["CMAKE_CXX_SCAN_FOR_MODULES"] = True
tc.cache_variables["MP_UNITS_BUILD_CXX_MODULES"] = True
tc.cache_variables["MP_UNITS_API_STD_FORMAT"] = str(
self.dependencies["mp-units"].options.std_format
)
).upper()
tc.generate()

def build(self):
Expand Down

0 comments on commit 437a9d5

Please sign in to comment.