c++modules: Persist CMAKE_CXX_STDLIB_MODULES_JSON

And change checks to look for a value rather than definition. This fix
keeps the same set of test cases in `RunCMake.CXXModules` selected as
before.

Fixes: #27589
This commit is contained in:
Ben Boeckel committed 2026-02-10 21:07:29 -05:00
1 parent 961ed3f2e9
commit 75a30136a1
4 files changed
+4 -6

No files matched your search

+1 -3
View File
@@ -98,6 +98,4 @@ set(CMAKE_CXX_COMPILER_CLANG_RESOURCE_DIR "@CMAKE_CXX_COMPILER_CLANG_RESOURCE_DI
set(CMAKE_CXX_COMPILER_IMPORT_STD "@CMAKE_CXX_COMPILER_IMPORT_STD@")
set(CMAKE_CXX_COMPILER_IMPORT_STD_ERROR_MESSAGE "@CMAKE_CXX_COMPILER_IMPORT_STD_ERROR_MESSAGE@")
if(CMAKE_CXX_STDLIB_MODULES_JSON)
set(CMAKE_CXX_STDLIB_MODULES_JSON "@CMAKE_CXX_STDLIB_MODULES_JSON@")
endif()
set(CMAKE_CXX_STDLIB_MODULES_JSON "@CMAKE_CXX_STDLIB_MODULES_JSON@")
@@ -8,7 +8,7 @@ function (_cmake_cxx_find_modules_json)
return ()
endif ()
if (NOT DEFINED CMAKE_CXX_STDLIB_MODULES_JSON)
if (NOT CMAKE_CXX_STDLIB_MODULES_JSON)
execute_process(
COMMAND
"${CMAKE_CXX_COMPILER}"
+1 -1
View File
@@ -4,7 +4,7 @@ function (_cmake_cxx_find_modules_json)
return ()
endif ()
if (NOT DEFINED CMAKE_CXX_STDLIB_MODULES_JSON)
if (NOT CMAKE_CXX_STDLIB_MODULES_JSON)
execute_process(
COMMAND
"${CMAKE_CXX_COMPILER}"
+1 -1
View File
@@ -1,5 +1,5 @@
function (_cmake_cxx_find_modules_json)
if (DEFINED CMAKE_CXX_STDLIB_MODULES_JSON)
if (CMAKE_CXX_STDLIB_MODULES_JSON)
return ()
endif ()