mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-14 05:20:50 -05:00
Tests/RunCMake/CXXModules: factor out generator support detection
This keeps the condition to a readable limit.
This commit is contained in:
@@ -36,10 +36,15 @@ if (RunCMake_GENERATOR MATCHES "Ninja")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
set(generator_supports_cxx_modules 0)
|
||||
if (RunCMake_GENERATOR MATCHES "Ninja" AND
|
||||
ninja_version VERSION_GREATER_EQUAL "1.10" AND
|
||||
"cxx_std_20" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
|
||||
set(generator_supports_cxx_modules 1)
|
||||
endif ()
|
||||
|
||||
# Test behavior when the generator does not support C++20 modules.
|
||||
if (NOT RunCMake_GENERATOR MATCHES "Ninja" OR
|
||||
ninja_version VERSION_LESS "1.10" OR
|
||||
NOT "cxx_std_20" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
|
||||
if (NOT generator_supports_cxx_modules)
|
||||
if ("cxx_std_20" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
|
||||
run_cmake(NoDyndepSupport)
|
||||
endif ()
|
||||
|
||||
Reference in New Issue
Block a user