Skip to content

Commit

Permalink
ci: set experimental flag outside CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
JohelEGP committed Sep 25, 2023
1 parent cf4c0ef commit 2ae1e68
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
12 changes: 0 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,6 @@ message(STATUS "${projectPrefix}BUILD_MODULES: ${${projectPrefix}BUILD_MODULES}"
option(${projectPrefix}BUILD_LA "Build code depending on the linear algebra library" ON)
message(STATUS "${projectPrefix}BUILD_LA: ${${projectPrefix}BUILD_LA}")

if(${projectPrefix}BUILD_MODULES)
if(CMAKE_VERSION VERSION_LESS "3.27.0")
set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "2182bf5c-ef0d-489a-91da-49dbc3090d2a")
elseif(CMAKE_VERSION VERSION_LESS "3.28.0")
set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7")
elseif(NOT (DEFINED CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API))
message(FATAL_ERROR
"${projectPrefix}BUILD_MODULES is set, but CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API is undefined."
)
endif()
endif()

# make sure that the file is being used as an entry point
include(modern_project_structure)
ensure_entry_point()
Expand Down
2 changes: 2 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ def generate(self):
tc.variables["MP_UNITS_BUILD_MODULES"] = self._build_modules
tc.variables["MP_UNITS_BUILD_LA"] = self._build_all and not self._skip_la
tc.variables["MP_UNITS_USE_LIBFMT"] = self._use_libfmt
if self._build_modules:
tc.variables["CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API"] = "aa1f7df0-828a-4fcd-9afc-2dc80491aca7"
tc.generate()
deps = CMakeDeps(self)
deps.generate()
Expand Down

0 comments on commit 2ae1e68

Please sign in to comment.