From 59a7e863e2591c8610d488aa2ea5ac6d6e7efa79 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 27 Nov 2024 13:16:12 -0700 Subject: [PATCH] Properly guard the creation of modules. --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b9f40c..07081f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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()