From e84fcbcb0b7c33caf35fbdfde411e8636f4d31f9 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 14 Dec 2022 13:44:52 -0500 Subject: cxxmodules: support new round of Clang patches These patches now support the `-MF` output, so remove the `none` support added just for the old patchset which did not use it. Also update the flag name to `-fmodule-output=`. Due to the new Clang module mapper flag, use a new experimental support UUID as well. --- .gitlab/ci/cxx_modules_rules_clang.cmake | 7 ++++--- Help/dev/experimental.rst | 2 +- Source/cmCxxModuleMapper.cxx | 2 +- Source/cmExperimental.cxx | 2 +- Source/cmNinjaTargetGenerator.cxx | 3 --- Tests/RunCMake/CXXModules/CMakeLists.txt | 2 +- Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake | 2 +- .../examples/export-bmi-and-interface-build/test/CMakeLists.txt | 2 +- .../examples/export-bmi-and-interface-install/test/CMakeLists.txt | 2 +- .../CXXModules/examples/export-interface-build/test/CMakeLists.txt | 2 +- .../examples/export-interface-install/test/CMakeLists.txt | 2 +- .../target_sources/FileSetDefaultWrongTypeExperimental.cmake | 2 +- Tests/RunCMake/target_sources/FileSetWrongTypeExperimental.cmake | 2 +- 13 files changed, 15 insertions(+), 17 deletions(-) diff --git a/.gitlab/ci/cxx_modules_rules_clang.cmake b/.gitlab/ci/cxx_modules_rules_clang.cmake index 9d75880..4b80aab 100644 --- a/.gitlab/ci/cxx_modules_rules_clang.cmake +++ b/.gitlab/ci/cxx_modules_rules_clang.cmake @@ -3,11 +3,12 @@ set(CMake_TEST_CXXModules_UUID "a246741c-d067-4019-a8fb-3d16b0c9d1d3") set(CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP 1) string(CONCAT CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE "${CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS}" - " -format=p1689 --p1689-targeted-file-name= --p1689-targeted-output= --" + " -format=p1689 --p1689-targeted-file-name= --p1689-targeted-output= " + " --p1689-makeformat-output=" + " --" " -x c++ " + " -MT -MD" " > ") -# No support for `-MF` discovered dependencies in `clang-scan-deps`. -set(CMAKE_EXPERIMENTAL_CXX_SCANDEP_DEPFILE_FORMAT "none") set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FORMAT "clang") set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FLAG "@") diff --git a/Help/dev/experimental.rst b/Help/dev/experimental.rst index fbbad30..c97d542 100644 --- a/Help/dev/experimental.rst +++ b/Help/dev/experimental.rst @@ -18,7 +18,7 @@ C++20 Module APIs ================= Variable: ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` -Value: ``9629ab6c-6c0e-423f-bb9d-cc5ac4a22041`` +Value: ``2182bf5c-ef0d-489a-91da-49dbc3090d2a`` In order to support C++20 modules, there are a number of behaviors that have CMake APIs to provide the required features to build and export them from a diff --git a/Source/cmCxxModuleMapper.cxx b/Source/cmCxxModuleMapper.cxx index ca4ffdf..cb37f2b 100644 --- a/Source/cmCxxModuleMapper.cxx +++ b/Source/cmCxxModuleMapper.cxx @@ -47,7 +47,7 @@ std::string CxxModuleMapContentClang(CxxModuleLocations const& loc, // extension. mm << "-x c++-module\n"; - mm << "-fsave-std-c++-module-file=" << *bmi_loc << '\n'; + mm << "-fmodule-output=" << *bmi_loc << '\n'; break; } } diff --git a/Source/cmExperimental.cxx b/Source/cmExperimental.cxx index bbb5840..c890e4b 100644 --- a/Source/cmExperimental.cxx +++ b/Source/cmExperimental.cxx @@ -27,7 +27,7 @@ struct FeatureData bool Warned; } LookupTable[] = { // CxxModuleCMakeApi - { "9629ab6c-6c0e-423f-bb9d-cc5ac4a22041", + { "2182bf5c-ef0d-489a-91da-49dbc3090d2a", "CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API", "CMake's C++ module support is experimental. It is meant only for " "experimentation and feedback to CMake developers.", diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 0807a98..6887376 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -562,9 +562,6 @@ cmNinjaRule GetScanRule( if (deptype == "msvc"_s) { rule.DepType = deptype; rule.DepFile.clear(); - } else if (deptype == "none"_s) { - rule.DepType.clear(); // no deps= for multiple outputs - rule.DepFile.clear(); } else { rule.DepType.clear(); // no deps= for multiple outputs rule.DepFile = "$DEP_FILE"; diff --git a/Tests/RunCMake/CXXModules/CMakeLists.txt b/Tests/RunCMake/CXXModules/CMakeLists.txt index 4611999..5246bef 100644 --- a/Tests/RunCMake/CXXModules/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.23) project(${RunCMake_TEST} NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "9629ab6c-6c0e-423f-bb9d-cc5ac4a22041") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "2182bf5c-ef0d-489a-91da-49dbc3090d2a") include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake b/Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake index 9768543..5f34fc0 100644 --- a/Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake +++ b/Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake @@ -1,4 +1,4 @@ -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "9629ab6c-6c0e-423f-bb9d-cc5ac4a22041") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "2182bf5c-ef0d-489a-91da-49dbc3090d2a") if (NOT EXISTS "${CMake_TEST_MODULE_COMPILATION_RULES}") message(FATAL_ERROR diff --git a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt index 20e4b2b..2e37da2 100644 --- a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "9629ab6c-6c0e-423f-bb9d-cc5ac4a22041") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "2182bf5c-ef0d-489a-91da-49dbc3090d2a") find_package(export_bmi_and_interfaces REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt index 4fd9dca..1adccb3 100644 --- a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "9629ab6c-6c0e-423f-bb9d-cc5ac4a22041") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "2182bf5c-ef0d-489a-91da-49dbc3090d2a") find_package(export_bmi_and_interfaces REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt index 80f7c36..69fc2db 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "9629ab6c-6c0e-423f-bb9d-cc5ac4a22041") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "2182bf5c-ef0d-489a-91da-49dbc3090d2a") find_package(export_interfaces REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt index 80f7c36..69fc2db 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "9629ab6c-6c0e-423f-bb9d-cc5ac4a22041") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "2182bf5c-ef0d-489a-91da-49dbc3090d2a") find_package(export_interfaces REQUIRED) diff --git a/Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental.cmake b/Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental.cmake index 1809505..1a76e10 100644 --- a/Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental.cmake +++ b/Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental.cmake @@ -1,6 +1,6 @@ enable_language(C) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "9629ab6c-6c0e-423f-bb9d-cc5ac4a22041") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "2182bf5c-ef0d-489a-91da-49dbc3090d2a") add_library(lib1 STATIC empty.c) target_sources(lib1 PRIVATE FILE_SET UNKNOWN) diff --git a/Tests/RunCMake/target_sources/FileSetWrongTypeExperimental.cmake b/Tests/RunCMake/target_sources/FileSetWrongTypeExperimental.cmake index 064cacb..17b37aa 100644 --- a/Tests/RunCMake/target_sources/FileSetWrongTypeExperimental.cmake +++ b/Tests/RunCMake/target_sources/FileSetWrongTypeExperimental.cmake @@ -1,6 +1,6 @@ enable_language(C) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "9629ab6c-6c0e-423f-bb9d-cc5ac4a22041") +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "2182bf5c-ef0d-489a-91da-49dbc3090d2a") add_library(lib1 STATIC empty.c) target_sources(lib1 PRIVATE FILE_SET a TYPE UNKNOWN) -- cgit v0.12