Skip to content

Commit

Permalink
Merge pull request #257 from bangerth/cmake-2
Browse files Browse the repository at this point in the history
Properly guard the creation of modules.
  • Loading branch information
bangerth authored Nov 27, 2024
2 parents b450083 + 59a7e86 commit 0831844
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,13 @@ INSTALL(FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}config.cmake"


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

Expand Down

0 comments on commit 0831844

Please sign in to comment.