Skip to content

Commit 0831844

Browse files
authored
Merge pull request #257 from bangerth/cmake-2
Properly guard the creation of modules.
2 parents b450083 + 59a7e86 commit 0831844

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,13 @@ INSTALL(FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}config.cmake"
113113

114114

115115
# Now also define a library that consists of the C++20 modules,
116-
# assuming the compiler supports this:
117-
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
116+
# assuming the compiler and generator supports this:
117+
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang"
118+
AND
119+
${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER_EQUAL 16
120+
AND
121+
${CMAKE_GENERATOR} STREQUAL "Ninja")
122+
message(STATUS "Enabling the use of C++20-style modules")
118123
set(SAMPLEFLOW_BUILD_MODULE "ON")
119124
endif()
120125

0 commit comments

Comments
 (0)