summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-09-25 12:55:53 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-09-25 12:56:04 (GMT)
commit82a2f198d8794a5a4c337f754c770d68d5e896a1 (patch)
treebfaf0b75310ac314ff07655d5a69eb2532f03ca9 /Modules
parent1db7ca915fc497889e5539831f7d9e1c4b6263e9 (diff)
parent40899545954d9c80fbffd61b206385f7b0666c6c (diff)
downloadCMake-82a2f198d8794a5a4c337f754c770d68d5e896a1.zip
CMake-82a2f198d8794a5a4c337f754c770d68d5e896a1.tar.gz
CMake-82a2f198d8794a5a4c337f754c770d68d5e896a1.tar.bz2
Merge topic 'cxxmodules-gcc-14'
4089954595 gitlab-ci: update to GCC CI container with merged P1689R5 c2564f5916 ci: drop extra scandep source settings for GCC ee52a02d56 ci: update GCC build to use master after P1689R5 is merged 4f0410959e GCC: add rules for scanning C++ module dependencies Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8827
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Compiler/GNU-CXX.cmake21
1 files changed, 21 insertions, 0 deletions
diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake
index b35f254..c276f4e 100644
--- a/Modules/Compiler/GNU-CXX.cmake
+++ b/Modules/Compiler/GNU-CXX.cmake
@@ -72,3 +72,24 @@ elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
endif()
__compiler_check_default_language_standard(CXX 3.4 98 6.0 14 11.1 17)
+
+if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 14.0)
+ string(CONCAT CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE
+ "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E -x c++ <SOURCE>"
+ " -MT <DYNDEP_FILE> -MD -MF <DEP_FILE>"
+ " -fmodules-ts -fdeps-file=<DYNDEP_FILE> -fdeps-target=<OBJECT> -fdeps-format=p1689r5"
+ " -o <PREPROCESSED_SOURCE>")
+ set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FORMAT "gcc")
+ string(CONCAT CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FLAG
+ # Turn on modules.
+ "-fmodules-ts"
+ # Read the module mapper file.
+ " -fmodule-mapper=<MODULE_MAP_FILE>"
+ # Make sure dependency tracking is enabled (missing from `try_*`).
+ " -MD"
+ # Suppress `CXX_MODULES +=` from generated depfile snippets.
+ " -fdeps-format=p1689r5"
+ # Force C++ as a language.
+ " -x c++")
+ set(CMAKE_EXPERIMENTAL_CXX_MODULE_BMI_ONLY_FLAG "-fmodule-only")
+endif()