From 68caec9137f47fda219995db7cfdf588886c84a1 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 22 Sep 2023 13:54:09 -0400 Subject: [PATCH 1/8] Help: add a manpage for cxxmodule support --- Help/index.rst | 1 + Help/manual/cmake-cxxmodules.7.rst | 55 ++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 Help/manual/cmake-cxxmodules.7.rst diff --git a/Help/index.rst b/Help/index.rst index 16c8f25cc5d..ca03213184b 100644 --- a/Help/index.rst +++ b/Help/index.rst @@ -58,6 +58,7 @@ Reference Manuals /manual/cmake-commands.7 /manual/cmake-compile-features.7 /manual/cmake-configure-log.7 + /manual/cmake-cxxmodules.7 /manual/cmake-developer.7 /manual/cmake-env-variables.7 /manual/cmake-file-api.7 diff --git a/Help/manual/cmake-cxxmodules.7.rst b/Help/manual/cmake-cxxmodules.7.rst new file mode 100644 index 00000000000..91acae1986b --- /dev/null +++ b/Help/manual/cmake-cxxmodules.7.rst @@ -0,0 +1,55 @@ +.. cmake-manual-description: CMake C++ Modules Support Reference + +cmake-cxxmodules(7) +******************* + +.. versionadded:: 3.28 + +C++ 20 introduced the concept of "modules" to the language. The design +requires build systems to order compilations among each other to satisfy +``import`` statements reliably. CMake's implementation asks the compiler +to scan source files for module dependencies during the build, collates +scanning results to infer ordering constraints, and tells the build tool +how to dynamically update the build graph. + +Compiler Support +================ + +Compilers which CMake natively supports module dependency scanning include: + +* MSVC toolset 14.34 and newer (provided with Visual Studio 17.4 and newer) +* LLVM/Clang 16.0 and newer +* GCC 14 (for the in-development branch, after 2023-09-20) and newer + +Generator Support +================= + +The list of generators which support scanning sources for C++ modules include: + +- :generator:`Ninja` +- :generator:`Ninja Multi-Config` +- :generator:`Visual Studio 17 2022` + +Limitations +----------- + +There are a number of known limitations of the current C++ module support in +CMake. This does not document known limitations or bugs in compilers as these +can change over time. + +For all generators: + +- Header units are not supported. +- No builtin support for ``import std;`` or other compiler-provided modules. + +For the Ninja Generators: + +- ``ninja`` 1.11 or newer is required. + +For the :ref:`Visual Studio Generators`: + +- Only Visual Studio 2022 and MSVC toolsets 14.34 (Visual Studio + 17.4) and newer. +- No support for exporting or installing BMI or module information. +- No diagnosis of using modules provided by ``PRIVATE`` sources from + ``PUBLIC`` module sources. -- GitLab From 0c07f390068fe5a9c3c99ebc64f6e6c72b6eff41 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 21 Sep 2023 16:03:08 -0400 Subject: [PATCH 2/8] cmExperimental: remove the flag for C++ modules All the major compilers now have scheduled releases with support for scanning, so remove the experimental gate. Fixes: #18355 --- Auxiliary/vim/syntax/cmake.vim | 3 - Help/command/export.rst | 5 +- Help/command/install.rst | 10 +- Help/command/target_sources.rst | 5 +- Help/command/try_compile.rst | 7 +- Help/dev/experimental.rst | 130 ------------------ Help/prop_sf/CXX_SCAN_FOR_MODULES.rst | 7 +- Help/prop_tgt/CXX_MODULE_DIRS.rst | 6 +- Help/prop_tgt/CXX_MODULE_DIRS_NAME.rst | 6 +- Help/prop_tgt/CXX_MODULE_SET.rst | 6 +- Help/prop_tgt/CXX_MODULE_SETS.rst | 6 +- Help/prop_tgt/CXX_MODULE_SET_NAME.rst | 6 +- Help/prop_tgt/CXX_SCAN_FOR_MODULES.rst | 7 +- ...PORTED_CXX_MODULES_COMPILE_DEFINITIONS.rst | 4 - .../IMPORTED_CXX_MODULES_COMPILE_FEATURES.rst | 4 - .../IMPORTED_CXX_MODULES_COMPILE_OPTIONS.rst | 4 - ...PORTED_CXX_MODULES_INCLUDE_DIRECTORIES.rst | 4 - .../IMPORTED_CXX_MODULES_LINK_LIBRARIES.rst | 4 - Help/prop_tgt/INTERFACE_CXX_MODULE_SETS.rst | 6 +- .../dev/cxxmodules-no-longer-experimental.rst | 8 ++ Help/variable/CMAKE_CXX_SCAN_FOR_MODULES.rst | 7 +- Source/cmCoreTryCompile.cxx | 17 +-- Source/cmExperimental.cxx | 11 -- Source/cmExperimental.h | 1 - Source/cmExportCommand.cxx | 15 +- Source/cmGeneratorTarget.cxx | 16 +-- Source/cmGeneratorTarget.h | 4 +- Source/cmInstallCommand.cxx | 25 +--- Source/cmTargetSourcesCommand.cxx | 31 ++--- Tests/RunCMake/CXXModules/CMakeLists.txt | 2 - .../ExportBuildCxxModules-stderr.txt | 6 - .../ExportInstallCxxModules-stderr.txt | 6 - .../FileSetModulesInterface-stderr.txt | 7 - ...FileSetModulesInterfaceImported-stderr.txt | 6 - .../FileSetModulesPrivate-stderr.txt | 6 - .../FileSetModulesPublic-stderr.txt | 6 - .../RunCMake/CXXModules/InstallBMI-stderr.txt | 6 - .../InstallBMIGenericArgs-stderr.txt | 6 - .../CXXModules/InstallBMIIgnore-stderr.txt | 6 - .../NinjaDependInfoBMIInstall-stderr.txt | 6 - .../NinjaDependInfoExport-stderr.txt | 6 - .../NinjaDependInfoFileSet-stderr.txt | 6 - Tests/RunCMake/CXXModules/NoCXX-stderr.txt | 7 - Tests/RunCMake/CXXModules/NoCXX20-stderr.txt | 7 - .../CXXModules/NoCXX20ModuleFlag-result.txt | 1 - .../CXXModules/NoCXX20ModuleFlag-stderr.txt | 20 --- .../CXXModules/NoCXX20ModuleFlag.cmake | 14 -- .../CXXModules/NoDyndepSupport-stderr.txt | 7 - .../CXXModules/NotCXXSourceModules-stderr.txt | 7 - .../NotCompiledSourceModules-stderr.txt | 7 - Tests/RunCMake/CXXModules/RunCMakeTest.cmake | 4 - .../CXXModules/examples/circular-stderr.txt | 4 - .../examples/cxx-modules-rules.cmake | 2 - .../CXXModules/examples/deep-chain-stderr.txt | 4 - .../CXXModules/examples/duplicate-stderr.txt | 4 - .../export-bmi-and-interface-build-stderr.txt | 4 - .../test/CMakeLists.txt | 2 - ...xport-bmi-and-interface-install-stderr.txt | 4 - .../test/CMakeLists.txt | 2 - .../export-compile-commands-stderr.txt | 4 - ...xport-include-directories-build-stderr.txt | 4 - ...ort-include-directories-install-stderr.txt | 4 - .../export-interface-build-stderr.txt | 4 - .../test/CMakeLists.txt | 2 - .../export-interface-install-stderr.txt | 4 - .../test/CMakeLists.txt | 2 - ...t-interface-no-properties-build-stderr.txt | 4 - .../test/CMakeLists.txt | 2 - ...interface-no-properties-install-stderr.txt | 4 - .../test/CMakeLists.txt | 2 - .../examples/export-usage-build-stderr.txt | 4 - .../export-usage-build/test/CMakeLists.txt | 2 - .../examples/export-usage-install-stderr.txt | 4 - .../export-usage-install/test/CMakeLists.txt | 2 - .../CXXModules/examples/generated-stderr.txt | 4 - ...-export-bmi-and-interface-build-stderr.txt | 7 - ...xport-bmi-and-interface-install-stderr.txt | 7 - ...xport-include-directories-build-stderr.txt | 7 - ...ort-include-directories-install-stderr.txt | 7 - ...-modules-export-interface-build-stderr.txt | 7 - ...odules-export-interface-install-stderr.txt | 7 - ...t-interface-no-properties-build-stderr.txt | 7 - ...interface-no-properties-install-stderr.txt | 7 - .../install-bmi-and-interfaces-stderr.txt | 4 - .../examples/install-bmi-stderr.txt | 4 - .../examples/internal-partitions-stderr.txt | 4 - .../examples/library-shared-stderr.txt | 4 - .../examples/library-static-stderr.txt | 4 - .../examples/object-library-stderr.txt | 4 - .../CXXModules/examples/partitions-stderr.txt | 4 - .../examples/public-req-private-stderr.txt | 4 - .../req-private-other-target-stderr.txt | 4 - .../examples/same-src-name-stderr.txt | 4 - .../examples/scan_properties-stderr.txt | 4 - .../CXXModules/examples/simple-stderr.txt | 4 - .../examples/try-compile-stderr.txt | 4 - .../CXXModules/examples/try-run-stderr.txt | 4 - .../codemodel-v2-data/directories/cxx.json | 34 +++++ .../codemodel-v2-data/directories/object.json | 68 +++++++++ .../FileSetDefaultWrongType-stderr.txt | 2 +- ...SetDefaultWrongTypeExperimental-result.txt | 1 - ...SetDefaultWrongTypeExperimental-stderr.txt | 11 -- .../FileSetDefaultWrongTypeExperimental.cmake | 6 - .../FileSetWrongType-stderr.txt | 2 +- .../FileSetWrongTypeExperimental-result.txt | 1 - .../FileSetWrongTypeExperimental-stderr.txt | 11 -- .../FileSetWrongTypeExperimental.cmake | 6 - .../target_sources/RunCMakeTest.cmake | 2 - 108 files changed, 157 insertions(+), 691 deletions(-) create mode 100644 Help/release/dev/cxxmodules-no-longer-experimental.rst delete mode 100644 Tests/RunCMake/CXXModules/ExportBuildCxxModules-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/ExportInstallCxxModules-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/FileSetModulesInterfaceImported-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/FileSetModulesPrivate-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/FileSetModulesPublic-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/InstallBMI-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/InstallBMIGenericArgs-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/InstallBMIIgnore-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/NinjaDependInfoBMIInstall-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/NinjaDependInfoExport-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/NinjaDependInfoFileSet-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/NoCXX20ModuleFlag-result.txt delete mode 100644 Tests/RunCMake/CXXModules/NoCXX20ModuleFlag-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/NoCXX20ModuleFlag.cmake delete mode 100644 Tests/RunCMake/CXXModules/examples/circular-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/deep-chain-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/duplicate-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/export-compile-commands-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/export-include-directories-build-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/export-include-directories-install-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/export-interface-build-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/export-interface-install-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/export-usage-build-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/export-usage-install-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/generated-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/import-modules-export-bmi-and-interface-build-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/import-modules-export-bmi-and-interface-install-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/import-modules-export-include-directories-build-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/import-modules-export-include-directories-install-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/import-modules-export-interface-build-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/import-modules-export-interface-install-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/import-modules-export-interface-no-properties-build-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/import-modules-export-interface-no-properties-install-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/install-bmi-and-interfaces-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/install-bmi-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/internal-partitions-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/library-shared-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/library-static-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/object-library-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/partitions-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/public-req-private-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/req-private-other-target-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/same-src-name-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/scan_properties-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/simple-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/try-compile-stderr.txt delete mode 100644 Tests/RunCMake/CXXModules/examples/try-run-stderr.txt delete mode 100644 Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental-result.txt delete mode 100644 Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental-stderr.txt delete mode 100644 Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental.cmake delete mode 100644 Tests/RunCMake/target_sources/FileSetWrongTypeExperimental-result.txt delete mode 100644 Tests/RunCMake/target_sources/FileSetWrongTypeExperimental-stderr.txt delete mode 100644 Tests/RunCMake/target_sources/FileSetWrongTypeExperimental.cmake diff --git a/Auxiliary/vim/syntax/cmake.vim b/Auxiliary/vim/syntax/cmake.vim index 82dc5636007..4bbdc65a491 100644 --- a/Auxiliary/vim/syntax/cmake.vim +++ b/Auxiliary/vim/syntax/cmake.vim @@ -3137,7 +3137,6 @@ syn keyword cmakeKWexecute_process contained syn keyword cmakeKWexport contained \ ANDROID_MK \ APPEND - \ CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API \ CONFIG \ CXX_MODULES_DIRECTORY \ EXPORT @@ -3707,7 +3706,6 @@ syn keyword cmakeKWinstall contained \ BUILD_TYPE \ BUNDLE \ BUNDLE_EXECUTABLE - \ CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API \ CMAKE_INSTALL_BINDIR \ CMAKE_INSTALL_DATADIR \ CMAKE_INSTALL_DATAROOTDIR @@ -4258,7 +4256,6 @@ syn keyword cmakeKWtarget_sources contained \ ALIAS \ BASE_DIRS \ BUILD_INTERFACE - \ CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API \ CONFIG \ CORRECT \ CXX_MODULES diff --git a/Help/command/export.rst b/Help/command/export.rst index 2e14a105e99..cc927bc778f 100644 --- a/Help/command/export.rst +++ b/Help/command/export.rst @@ -54,10 +54,7 @@ The options are: to support consumers using CMake versions older than 2.8.12. ``CXX_MODULES_DIRECTORY `` - - .. note :: - - Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` + .. versionadded:: 3.28 Export C++ module properties to files under the given directory. Each file will be named according to the target's export name (without any namespace). diff --git a/Help/command/install.rst b/Help/command/install.rst index 4de3ce126ec..b0698dd5782 100644 --- a/Help/command/install.rst +++ b/Help/command/install.rst @@ -232,10 +232,7 @@ Signatures would be installed to ``myproj/here.h`` below the destination. ``CXX_MODULES_BMI`` - - .. note :: - - Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` + .. versionadded:: 3.28 Any module files from C++ modules from ``PUBLIC`` sources in a file set of type ``CXX_MODULES`` will be installed to the given ``DESTINATION``. All @@ -843,10 +840,7 @@ Signatures and defines required to use the libraries. ``CXX_MODULES_DIRECTORY`` - - .. note :: - - Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` + .. versionadded:: 3.28 Specify a subdirectory to store C++ module information for targets in the export set. This directory will be populated with files which add the diff --git a/Help/command/target_sources.rst b/Help/command/target_sources.rst index 86bf7fbe67a..40755c5b234 100644 --- a/Help/command/target_sources.rst +++ b/Help/command/target_sources.rst @@ -84,10 +84,7 @@ files within those directories. The acceptable types include: Sources intended to be used via a language's ``#include`` mechanism. ``CXX_MODULES`` - - .. note :: - - Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` + .. versionadded:: 3.28 Sources which contain C++ interface module or partition units (i.e., those using the ``export`` keyword). This file set type may not have an diff --git a/Help/command/try_compile.rst b/Help/command/try_compile.rst index bc2b0af3ce4..0255b4d984b 100644 --- a/Help/command/try_compile.rst +++ b/Help/command/try_compile.rst @@ -261,14 +261,11 @@ The options for the above signatures are: Sources are not added to any ``FILE_SET`` in the generated project. ``CXX_MODULE`` + .. versionadded:: 3.28 + Sources are added to a ``FILE_SET`` of type ``CXX_MODULES`` in the generated project. - .. note :: - - Experimental. Sources of type ``CXX_MODULE`` are gated by - ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` - The default type of sources is ``NORMAL``. ``_STANDARD `` diff --git a/Help/dev/experimental.rst b/Help/dev/experimental.rst index 046d214014e..87ac031f10f 100644 --- a/Help/dev/experimental.rst +++ b/Help/dev/experimental.rst @@ -13,133 +13,3 @@ specific values will change over time to reinforce their experimental nature. When used, a warning will be generated to indicate that an experimental feature is in use and that the affected behavior in the project is not part of CMake's stability guarantees. - -C++20 Module APIs -================= - -Variable: ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` -Value: ``ac01f462-0f5f-432a-86aa-acef252918a6`` - -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 -project. - -Limitations ------------ - -There are a number of known limitations of the current C++20 module support in -CMake. This does not document known limitations or bugs in compilers as these -can change over time. - -For all generators: - -- Only in-project modules may be used. While there is some support for - exporting module information, there is no mechanism for using it at the - moment. - -For the Ninja Generators: - -- ``ninja`` 1.10 or newer is required. - -For the Visual Studio Generators: - -- Only Visual Studio 2022 and toolchains newer than 19.34 (Visual Studio - 17.4). -- No support for exporting or installing BMI or module information. -- No diagnosis of using modules provided by ``PRIVATE`` sources from - ``PUBLIC`` module sources. - -C++20 Module Dependencies -========================= - -The Ninja generator has experimental infrastructure supporting C++20 module -dependency scanning. This is similar to the Fortran modules support, but -relies on external tools to scan C++20 translation units for module -dependencies. The approach is described by Kitware's `D1483r1`_ paper. - -In order to activate CMake's experimental support for C++20 module -dependencies, set the following variables: - -``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` - Set this to the UUID documented above. - -Some compilers already have support for module dependency scanning: - -* MSVC 19.34 and newer (provided with Visual Studio 17.4 and newer) -* LLVM/Clang 16.0 and newer - -For those, only the above variables need to be set by project code. -For compilers with in-development support, additional variables must -be set as follows. - -``CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE`` - Set this to tell CMake how to invoke the C++20 module dependency - scanning tool. - -``CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FORMAT`` - Set this for compilers that generate module maps. See below. - -``CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FLAG`` - Set this for compilers that generate module maps. See below. - -For example, add code like the following to a test project: - -.. code-block:: cmake - - string(CONCAT CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE - " " - " -MT -MD -MF " - " ${flags_to_scan_deps} -fdep-file= -fdep-output=" - ) - -The tool specified by ``CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE`` is -expected to process the translation unit, write preprocessor dependencies -to the file specified by the ```` placeholder, and write module -dependencies to the file specified by the ```` placeholder. The -``CMAKE_EXPERIMENTAL_CXX_SCANDEP_DEPFILE_FORMAT`` file may be set to ``msvc`` -for scandep rules which use ``msvc``-style dependency reporting. - -In order to support ``IMPORTED`` targets with associated C++20 module sources, -the ``CMAKE_EXPERIMENTAL_CXX_MODULE_BMI_ONLY_FLAG`` variable must be provided -to have the compiler only output a BMI instead of a BMI and an object file. - -The module dependencies should be written in the format described -by the `P1689r5`_ paper. - -Compiler writers may try out their scanning functionality using -the `cxx-modules-sandbox`_ test project, modified to set variables -as above for their compiler. - -For compilers that generate module maps, tell CMake as follows: - -.. code-block:: cmake - - set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FORMAT "gcc") - set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FLAG - "${compiler_flags_for_module_map} -fmodule-mapper=") - set(CMAKE_EXPERIMENTAL_CXX_MODULE_BMI_ONLY_FLAG - "-fmodule-only") - -Currently, the only supported formats are, ``clang``, ``gcc``, and ``msvc``. -The ``gcc`` format is described in the GCC documentation, but the relevant -section for the purposes of CMake is: - - A mapping file consisting of space-separated module-name, filename - pairs, one per line. Only the mappings for the direct imports and any - module export name need be provided. If other mappings are provided, - they override those stored in any imported CMI files. A repository - root may be specified in the mapping file by using ``$root`` as the - module name in the first active line. - - -- GCC module mapper documentation - -The ``msvc`` format is a response file containing flags required to compile -any module interfaces properly as well as find any required files to satisfy -``import`` statements as required for Microsoft's Visual Studio toolchains. - -Similarly, the ``clang`` format is a response file containing flags using -Clang's module flags. - -.. _`D1483r1`: https://mathstuf.fedorapeople.org/fortran-modules/fortran-modules.html -.. _`P1689r5`: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1689r5.html -.. _`cxx-modules-sandbox`: https://github.com/mathstuf/cxx-modules-sandbox diff --git a/Help/prop_sf/CXX_SCAN_FOR_MODULES.rst b/Help/prop_sf/CXX_SCAN_FOR_MODULES.rst index 5b704dccbdd..d10969a0431 100644 --- a/Help/prop_sf/CXX_SCAN_FOR_MODULES.rst +++ b/Help/prop_sf/CXX_SCAN_FOR_MODULES.rst @@ -1,7 +1,7 @@ CXX_SCAN_FOR_MODULES -------------------- -.. versionadded:: 3.26 +.. versionadded:: 3.28 ``CXX_SCAN_FOR_MODULES`` is a boolean specifying whether CMake will scan the source for C++ module dependencies. See also the @@ -16,8 +16,3 @@ consulted. Note that scanning is only performed if C++20 or higher is enabled for the target and the source uses the ``CXX`` language. Scanning for modules in sources belonging to file sets of type ``CXX_MODULES`` is always performed. - -.. note :: - - This setting is meaningful only when experimental support for C++ modules - has been enabled by the ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` gate. diff --git a/Help/prop_tgt/CXX_MODULE_DIRS.rst b/Help/prop_tgt/CXX_MODULE_DIRS.rst index a32b5b178ac..6c5dd3a4986 100644 --- a/Help/prop_tgt/CXX_MODULE_DIRS.rst +++ b/Help/prop_tgt/CXX_MODULE_DIRS.rst @@ -1,11 +1,7 @@ CXX_MODULE_DIRS --------------- -.. versionadded:: 3.25 - -.. note :: - - Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` +.. versionadded:: 3.28 Semicolon-separated list of base directories of the target's default C++ module set (i.e. the file set with name and type ``CXX_MODULES``). The diff --git a/Help/prop_tgt/CXX_MODULE_DIRS_NAME.rst b/Help/prop_tgt/CXX_MODULE_DIRS_NAME.rst index 91909910500..8b6e4dd20e3 100644 --- a/Help/prop_tgt/CXX_MODULE_DIRS_NAME.rst +++ b/Help/prop_tgt/CXX_MODULE_DIRS_NAME.rst @@ -1,11 +1,7 @@ CXX_MODULE_DIRS_ ---------------------- -.. versionadded:: 3.25 - -.. note :: - - Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` +.. versionadded:: 3.28 Semicolon-separated list of base directories of the target's ```` C++ module set, which has the set type ``CXX_MODULES``. The property supports diff --git a/Help/prop_tgt/CXX_MODULE_SET.rst b/Help/prop_tgt/CXX_MODULE_SET.rst index f5cd8b2c26b..851de86ebee 100644 --- a/Help/prop_tgt/CXX_MODULE_SET.rst +++ b/Help/prop_tgt/CXX_MODULE_SET.rst @@ -1,11 +1,7 @@ CXX_MODULE_SET -------------- -.. versionadded:: 3.25 - -.. note :: - - Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` +.. versionadded:: 3.28 Semicolon-separated list of files in the target's default C++ module set, (i.e. the file set with name and type ``CXX_MODULES``). If any of the paths diff --git a/Help/prop_tgt/CXX_MODULE_SETS.rst b/Help/prop_tgt/CXX_MODULE_SETS.rst index 0e8945ad09c..21650271864 100644 --- a/Help/prop_tgt/CXX_MODULE_SETS.rst +++ b/Help/prop_tgt/CXX_MODULE_SETS.rst @@ -1,11 +1,7 @@ CXX_MODULE_SETS --------------- -.. versionadded:: 3.25 - -.. note :: - - Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` +.. versionadded:: 3.28 Read-only list of the target's ``PRIVATE`` and ``PUBLIC`` C++ module sets (i.e. all file sets with the type ``CXX_MODULES``). Files listed in these file sets diff --git a/Help/prop_tgt/CXX_MODULE_SET_NAME.rst b/Help/prop_tgt/CXX_MODULE_SET_NAME.rst index 5674c99809c..e73e28ae98a 100644 --- a/Help/prop_tgt/CXX_MODULE_SET_NAME.rst +++ b/Help/prop_tgt/CXX_MODULE_SET_NAME.rst @@ -1,11 +1,7 @@ CXX_MODULE_SET_ --------------------- -.. versionadded:: 3.25 - -.. note :: - - Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` +.. versionadded:: 3.28 Semicolon-separated list of files in the target's ```` C++ module set, which has the set type ``CXX_MODULES``. If any of the paths are relative, they diff --git a/Help/prop_tgt/CXX_SCAN_FOR_MODULES.rst b/Help/prop_tgt/CXX_SCAN_FOR_MODULES.rst index 93a1b73dbbf..791914e316b 100644 --- a/Help/prop_tgt/CXX_SCAN_FOR_MODULES.rst +++ b/Help/prop_tgt/CXX_SCAN_FOR_MODULES.rst @@ -1,7 +1,7 @@ CXX_SCAN_FOR_MODULES -------------------- -.. versionadded:: 3.26 +.. versionadded:: 3.28 ``CXX_SCAN_FOR_MODULES`` is a boolean specifying whether CMake will scan C++ sources in the target for module dependencies. See also the @@ -20,8 +20,3 @@ scan the target's ``CXX`` sources at build time. Note that scanning is only performed if C++20 or higher is enabled for the target. Scanning for modules in the target's sources belonging to file sets of type ``CXX_MODULES`` is always performed. - -.. note :: - - This setting is meaningful only when experimental support for C++ modules - has been enabled by the ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` gate. diff --git a/Help/prop_tgt/IMPORTED_CXX_MODULES_COMPILE_DEFINITIONS.rst b/Help/prop_tgt/IMPORTED_CXX_MODULES_COMPILE_DEFINITIONS.rst index 88687b279f6..b0681914d41 100644 --- a/Help/prop_tgt/IMPORTED_CXX_MODULES_COMPILE_DEFINITIONS.rst +++ b/Help/prop_tgt/IMPORTED_CXX_MODULES_COMPILE_DEFINITIONS.rst @@ -3,10 +3,6 @@ IMPORTED_CXX_MODULES_COMPILE_DEFINITIONS .. versionadded:: 3.28 -.. note :: - - Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` - Preprocessor definitions for compiling an ``IMPORTED`` target's C++ module sources. diff --git a/Help/prop_tgt/IMPORTED_CXX_MODULES_COMPILE_FEATURES.rst b/Help/prop_tgt/IMPORTED_CXX_MODULES_COMPILE_FEATURES.rst index c3eb7fbb690..cea359f5b09 100644 --- a/Help/prop_tgt/IMPORTED_CXX_MODULES_COMPILE_FEATURES.rst +++ b/Help/prop_tgt/IMPORTED_CXX_MODULES_COMPILE_FEATURES.rst @@ -3,10 +3,6 @@ IMPORTED_CXX_MODULES_COMPILE_FEATURES .. versionadded:: 3.28 -.. note :: - - Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` - Compiler features enabled for this ``IMPORTED`` target's C++ modules. The value of this property is used by the generators to set the include diff --git a/Help/prop_tgt/IMPORTED_CXX_MODULES_COMPILE_OPTIONS.rst b/Help/prop_tgt/IMPORTED_CXX_MODULES_COMPILE_OPTIONS.rst index 5c62c77d39a..cf7bc5b238c 100644 --- a/Help/prop_tgt/IMPORTED_CXX_MODULES_COMPILE_OPTIONS.rst +++ b/Help/prop_tgt/IMPORTED_CXX_MODULES_COMPILE_OPTIONS.rst @@ -3,10 +3,6 @@ IMPORTED_CXX_MODULES_COMPILE_OPTIONS .. versionadded:: 3.28 -.. note :: - - Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` - List of options to pass to the compiler for this ``IMPORTED`` target's C++ modules. diff --git a/Help/prop_tgt/IMPORTED_CXX_MODULES_INCLUDE_DIRECTORIES.rst b/Help/prop_tgt/IMPORTED_CXX_MODULES_INCLUDE_DIRECTORIES.rst index 08a993d8252..46d74ea27fc 100644 --- a/Help/prop_tgt/IMPORTED_CXX_MODULES_INCLUDE_DIRECTORIES.rst +++ b/Help/prop_tgt/IMPORTED_CXX_MODULES_INCLUDE_DIRECTORIES.rst @@ -3,10 +3,6 @@ IMPORTED_CXX_MODULES_INCLUDE_DIRECTORIES .. versionadded:: 3.28 -.. note :: - - Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` - List of preprocessor include file search directories when compiling C++ modules for ``IMPORTED`` targets. diff --git a/Help/prop_tgt/IMPORTED_CXX_MODULES_LINK_LIBRARIES.rst b/Help/prop_tgt/IMPORTED_CXX_MODULES_LINK_LIBRARIES.rst index 5111dc55215..ff5cec87364 100644 --- a/Help/prop_tgt/IMPORTED_CXX_MODULES_LINK_LIBRARIES.rst +++ b/Help/prop_tgt/IMPORTED_CXX_MODULES_LINK_LIBRARIES.rst @@ -3,9 +3,5 @@ IMPORTED_CXX_MODULES_LINK_LIBRARIES .. versionadded:: 3.28 -.. note :: - - Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` - List of direct dependencies to use for usage requirements for C++ modules in the target's C++ modules. diff --git a/Help/prop_tgt/INTERFACE_CXX_MODULE_SETS.rst b/Help/prop_tgt/INTERFACE_CXX_MODULE_SETS.rst index c7ed46d6984..fd6e34bb043 100644 --- a/Help/prop_tgt/INTERFACE_CXX_MODULE_SETS.rst +++ b/Help/prop_tgt/INTERFACE_CXX_MODULE_SETS.rst @@ -1,11 +1,7 @@ INTERFACE_CXX_MODULE_SETS ------------------------- -.. versionadded:: 3.25 - -.. note :: - - Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` +.. versionadded:: 3.28 Read-only list of the target's ``PUBLIC`` C++ module sets (i.e. all file sets with the type ``CXX_MODULES``). Files listed in these C++ module sets can be diff --git a/Help/release/dev/cxxmodules-no-longer-experimental.rst b/Help/release/dev/cxxmodules-no-longer-experimental.rst new file mode 100644 index 00000000000..3ad45fe39e5 --- /dev/null +++ b/Help/release/dev/cxxmodules-no-longer-experimental.rst @@ -0,0 +1,8 @@ +cxxmodules-no-longer-experimental +--------------------------------- + +* C++ 20 named modules are now supported by :ref:`Ninja Generators` + and :ref:`Visual Studio Generators` for VS 2022 and newer, in combination + with the MSVC 14.34 toolset (provided with VS 17.4) and newer, LLVM/Clang + 16.0 and newer, and GCC 14 (after the 2023-09-20 daily bump) and newer. + See :manual:`cmake-cxxmodules(7)` for details. diff --git a/Help/variable/CMAKE_CXX_SCAN_FOR_MODULES.rst b/Help/variable/CMAKE_CXX_SCAN_FOR_MODULES.rst index a40bf7524a7..28601babd27 100644 --- a/Help/variable/CMAKE_CXX_SCAN_FOR_MODULES.rst +++ b/Help/variable/CMAKE_CXX_SCAN_FOR_MODULES.rst @@ -1,15 +1,10 @@ CMAKE_CXX_SCAN_FOR_MODULES -------------------------- -.. versionadded:: 3.26 +.. versionadded:: 3.28 Whether to scan C++ source files for module dependencies. This variable is used to initialize the :prop_tgt:`CXX_SCAN_FOR_MODULES` property on all the targets. See that target property for additional information. - -.. note :: - - This setting is meaningful only when experimental support for C++ modules - has been enabled by the ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` gate. diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index ee40bd51276..6ca0e14928f 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -235,25 +235,16 @@ ArgumentParser::Continue cmCoreTryCompile::Arguments::SetSourceType( this->SourceTypeContext = SourceType::Normal; matched = true; } else if (sourceType == "CXX_MODULE"_s) { - bool const supportCxxModuleSources = cmExperimental::HasSupportEnabled( - *this->Makefile, cmExperimental::Feature::CxxModuleCMakeApi); - if (supportCxxModuleSources) { - this->SourceTypeContext = SourceType::CxxModule; - matched = true; - } + this->SourceTypeContext = SourceType::CxxModule; + matched = true; } if (!matched && this->SourceTypeError.empty()) { - bool const supportCxxModuleSources = cmExperimental::HasSupportEnabled( - *this->Makefile, cmExperimental::Feature::CxxModuleCMakeApi); - auto const* message = "'SOURCE'"; - if (supportCxxModuleSources) { - message = "one of 'SOURCE' or 'CXX_MODULE'"; - } // Only remember one error at a time; all other errors related to argument // parsing are "indicate one error and return" anyways. this->SourceTypeError = - cmStrCat("Invalid 'SOURCE_TYPE' '", sourceType, "'; must be ", message); + cmStrCat("Invalid 'SOURCE_TYPE' '", sourceType, + "'; must be one of 'SOURCE' or 'CXX_MODULE'"); } return ArgumentParser::Continue::Yes; } diff --git a/Source/cmExperimental.cxx b/Source/cmExperimental.cxx index 104ab81217c..d75879f3d74 100644 --- a/Source/cmExperimental.cxx +++ b/Source/cmExperimental.cxx @@ -19,17 +19,6 @@ namespace { * up-to-date. */ cmExperimental::FeatureData LookupTable[] = { - // CxxModuleCMakeApi - { "CxxModuleCMakeApi", - "ac01f462-0f5f-432a-86aa-acef252918a6", - "CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API", - "CMake's C++ module support is experimental. It is meant only for " - "experimentation and feedback to CMake developers.", - { "CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE", - "CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FORMAT", - "CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FLAG" }, - cmExperimental::TryCompileCondition::SkipCompilerChecks, - false }, // WindowsKernelModeDriver { "WindowsKernelModeDriver", "5c2d848d-4efa-4529-a768-efd57171bf68", diff --git a/Source/cmExperimental.h b/Source/cmExperimental.h index c958ab68a6a..e4c14480878 100644 --- a/Source/cmExperimental.h +++ b/Source/cmExperimental.h @@ -15,7 +15,6 @@ class cmExperimental public: enum class Feature { - CxxModuleCMakeApi, WindowsKernelModeDriver, Sentinel, diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx index 273296d266d..e78b869f994 100644 --- a/Source/cmExportCommand.cxx +++ b/Source/cmExportCommand.cxx @@ -16,7 +16,6 @@ #include "cmArgumentParserTypes.h" #include "cmCryptoHash.h" #include "cmExecutionStatus.h" -#include "cmExperimental.h" #include "cmExportBuildAndroidMKGenerator.h" #include "cmExportBuildFileGenerator.h" #include "cmExportSet.h" @@ -69,15 +68,11 @@ bool cmExportCommand(std::vector const& args, bool ExportOld = false; }; - auto parser = cmArgumentParser{} - .Bind("NAMESPACE"_s, &Arguments::Namespace) - .Bind("FILE"_s, &Arguments::Filename); - - bool const supportCxx20FileSetTypes = cmExperimental::HasSupportEnabled( - status.GetMakefile(), cmExperimental::Feature::CxxModuleCMakeApi); - if (supportCxx20FileSetTypes) { - parser.Bind("CXX_MODULES_DIRECTORY"_s, &Arguments::CxxModulesDirectory); - } + auto parser = + cmArgumentParser{} + .Bind("NAMESPACE"_s, &Arguments::Namespace) + .Bind("FILE"_s, &Arguments::Filename) + .Bind("CXX_MODULES_DIRECTORY"_s, &Arguments::CxxModulesDirectory); if (args[0] == "EXPORT") { parser.Bind("EXPORT"_s, &Arguments::ExportSetName); diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 04d7bb10810..bbb47e40153 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -31,7 +31,6 @@ #include "cmCustomCommandGenerator.h" #include "cmCxxModuleUsageEffects.h" #include "cmEvaluatedTargetProperty.h" -#include "cmExperimental.h" #include "cmFileSet.h" #include "cmFileTimes.h" #include "cmGeneratedFileStream.h" @@ -9106,9 +9105,10 @@ cmGeneratorTarget::Cxx20SupportLevel cmGeneratorTarget::HaveCxxModuleSupport( // Else, an empty CMAKE_CXX_STANDARD_DEFAULT means CMake does not detect and // set a default standard level for this compiler, so assume all standards // are available. - if (!cmExperimental::HasSupportEnabled( - *this->Makefile, cmExperimental::Feature::CxxModuleCMakeApi)) { - return Cxx20SupportLevel::MissingExperimentalFlag; + cmValue scandepRule = + this->Target->GetMakefile()->GetDefinition("CMAKE_CXX_SCANDEP_SOURCE"); + if (!scandepRule) { + return Cxx20SupportLevel::MissingRule; } return Cxx20SupportLevel::Supported; } @@ -9125,13 +9125,6 @@ void cmGeneratorTarget::CheckCxxModuleStatus(std::string const& config) const "\" has C++ sources that export modules but the \"CXX\" " "language has not been enabled")); break; - case cmGeneratorTarget::Cxx20SupportLevel::MissingExperimentalFlag: - this->Makefile->IssueMessage( - MessageType::FATAL_ERROR, - cmStrCat("The target named \"", this->GetName(), - "\" has C++ sources that export modules but its " - "experimental support has not been requested")); - break; case cmGeneratorTarget::Cxx20SupportLevel::NoCxx20: { cmStandardLevelResolver standardResolver(this->Makefile); auto effStandard = @@ -9149,6 +9142,7 @@ void cmGeneratorTarget::CheckCxxModuleStatus(std::string const& config) const "\"cxx_std_20\" (or newer) among its `target_compile_features`", effStandard)); } break; + case cmGeneratorTarget::Cxx20SupportLevel::MissingRule: case cmGeneratorTarget::Cxx20SupportLevel::Supported: // All is well. break; diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 751f9070830..72920d69605 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -1288,10 +1288,10 @@ public: { // C++ is not available. MissingCxx, - // The experimental feature is not available. - MissingExperimentalFlag, // The target does not require at least C++20. NoCxx20, + // C++20 module scanning rules are not present. + MissingRule, // C++20 modules are available and working. Supported, }; diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index 1b47ec4fe39..0fc40119ee8 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -21,7 +21,6 @@ #include "cmArgumentParser.h" #include "cmArgumentParserTypes.h" #include "cmExecutionStatus.h" -#include "cmExperimental.h" #include "cmExportSet.h" #include "cmFileSet.h" #include "cmGeneratorExpression.h" @@ -491,6 +490,7 @@ bool HandleTargetsMode(std::vector const& args, publicHeaderArgs.Parse(argVectors.PublicHeader, &unknownArgs); resourceArgs.Parse(argVectors.Resource, &unknownArgs); includesArgs.Parse(&argVectors.Includes, &unknownArgs); + cxxModuleBmiArgs.Parse(argVectors.CxxModulesBmi, &unknownArgs); for (std::size_t i = 0; i < argVectors.FileSets.size(); i++) { // We have to create a separate object for the parsing because // cmArgumentParser::Bind() binds to a specific address, but the @@ -501,15 +501,6 @@ bool HandleTargetsMode(std::vector const& args, fileSetArgs[i] = std::move(fileSetArg); } - bool const supportCxx20FileSetTypes = cmExperimental::HasSupportEnabled( - *helper.Makefile, cmExperimental::Feature::CxxModuleCMakeApi); - if (!supportCxx20FileSetTypes) { - std::copy(argVectors.CxxModulesBmi.begin(), argVectors.CxxModulesBmi.end(), - std::back_inserter(unknownArgs)); - } else { - cxxModuleBmiArgs.Parse(argVectors.CxxModulesBmi, &unknownArgs); - } - if (!unknownArgs.empty()) { // Unknown argument. status.SetError( @@ -541,12 +532,10 @@ bool HandleTargetsMode(std::vector const& args, success = success && privateHeaderArgs.Finalize(); success = success && publicHeaderArgs.Finalize(); success = success && resourceArgs.Finalize(); + success = success && cxxModuleBmiArgs.Finalize(); for (auto& fileSetArg : fileSetArgs) { success = success && fileSetArg.Finalize(); } - if (supportCxx20FileSetTypes) { - success = success && cxxModuleBmiArgs.Finalize(); - } if (!success) { return false; @@ -1173,8 +1162,7 @@ bool HandleTargetsMode(std::vector const& args, } } - if (supportCxx20FileSetTypes && - !cxxModuleBmiArgs.GetDestination().empty()) { + if (!cxxModuleBmiArgs.GetDestination().empty()) { cxxModuleBmiGenerator = cm::make_unique( target.GetName(), helper.GetCxxModulesBmiDestination(&cxxModuleBmiArgs), @@ -2071,12 +2059,7 @@ bool HandleExportMode(std::vector const& args, ica.Bind("NAMESPACE"_s, name_space); ica.Bind("EXPORT_LINK_INTERFACE_LIBRARIES"_s, exportOld); ica.Bind("FILE"_s, filename); - - bool const supportCxx20FileSetTypes = cmExperimental::HasSupportEnabled( - *helper.Makefile, cmExperimental::Feature::CxxModuleCMakeApi); - if (supportCxx20FileSetTypes) { - ica.Bind("CXX_MODULES_DIRECTORY"_s, cxx_modules_directory); - } + ica.Bind("CXX_MODULES_DIRECTORY"_s, cxx_modules_directory); std::vector unknownArgs; ica.Parse(args, &unknownArgs); diff --git a/Source/cmTargetSourcesCommand.cxx b/Source/cmTargetSourcesCommand.cxx index 3d484f5e3a0..babbaa51cf9 100644 --- a/Source/cmTargetSourcesCommand.cxx +++ b/Source/cmTargetSourcesCommand.cxx @@ -10,7 +10,6 @@ #include "cmArgumentParser.h" #include "cmArgumentParserTypes.h" -#include "cmExperimental.h" #include "cmFileSet.h" #include "cmGeneratorExpression.h" #include "cmList.h" @@ -260,28 +259,18 @@ bool TargetSourcesImpl::HandleOneFileSet( this->SetError("Must specify a TYPE when creating file set"); return false; } - bool const supportCxx20FileSetTypes = cmExperimental::HasSupportEnabled( - *this->Makefile, cmExperimental::Feature::CxxModuleCMakeApi); + if (type != "HEADERS"_s && type != "CXX_MODULES"_s) { + this->SetError( + R"(File set TYPE may only be "HEADERS" or "CXX_MODULES")"); + return false; + } - if (supportCxx20FileSetTypes) { - if (type != "HEADERS"_s && type != "CXX_MODULES"_s) { + if (cmFileSetVisibilityIsForInterface(visibility) && + !cmFileSetVisibilityIsForSelf(visibility) && + !this->Target->IsImported()) { + if (type == "CXX_MODULES"_s) { this->SetError( - R"(File set TYPE may only be "HEADERS" or "CXX_MODULES")"); - return false; - } - - if (cmFileSetVisibilityIsForInterface(visibility) && - !cmFileSetVisibilityIsForSelf(visibility) && - !this->Target->IsImported()) { - if (type == "CXX_MODULES"_s) { - this->SetError( - R"(File set TYPE "CXX_MODULES" may not have "INTERFACE" visibility)"); - return false; - } - } - } else { - if (type != "HEADERS"_s) { - this->SetError("File set TYPE may only be \"HEADERS\""); + R"(File set TYPE "CXX_MODULES" may not have "INTERFACE" visibility)"); return false; } } diff --git a/Tests/RunCMake/CXXModules/CMakeLists.txt b/Tests/RunCMake/CXXModules/CMakeLists.txt index e23023d4aff..913371fc712 100644 --- a/Tests/RunCMake/CXXModules/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/CMakeLists.txt @@ -1,6 +1,4 @@ cmake_minimum_required(VERSION 3.23) project(${RunCMake_TEST} NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "ac01f462-0f5f-432a-86aa-acef252918a6") - include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CXXModules/ExportBuildCxxModules-stderr.txt b/Tests/RunCMake/CXXModules/ExportBuildCxxModules-stderr.txt deleted file mode 100644 index 49e869a8919..00000000000 --- a/Tests/RunCMake/CXXModules/ExportBuildCxxModules-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Warning \(dev\) at ExportBuildCxxModules.cmake:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/ExportInstallCxxModules-stderr.txt b/Tests/RunCMake/CXXModules/ExportInstallCxxModules-stderr.txt deleted file mode 100644 index 4a6969da480..00000000000 --- a/Tests/RunCMake/CXXModules/ExportInstallCxxModules-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Warning \(dev\) at ExportInstallCxxModules.cmake:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/FileSetModulesInterface-stderr.txt b/Tests/RunCMake/CXXModules/FileSetModulesInterface-stderr.txt index cb21e2c29e5..7269c65df97 100644 --- a/Tests/RunCMake/CXXModules/FileSetModulesInterface-stderr.txt +++ b/Tests/RunCMake/CXXModules/FileSetModulesInterface-stderr.txt @@ -1,10 +1,3 @@ -CMake Warning \(dev\) at FileSetModulesInterface.cmake:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. - CMake Error at FileSetModulesInterface.cmake:[0-9]+ \(target_sources\): target_sources File set TYPE "CXX_MODULES" may not have "INTERFACE" visibility diff --git a/Tests/RunCMake/CXXModules/FileSetModulesInterfaceImported-stderr.txt b/Tests/RunCMake/CXXModules/FileSetModulesInterfaceImported-stderr.txt deleted file mode 100644 index aae763bfda7..00000000000 --- a/Tests/RunCMake/CXXModules/FileSetModulesInterfaceImported-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Warning \(dev\) at FileSetModulesInterfaceImported.cmake:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/FileSetModulesPrivate-stderr.txt b/Tests/RunCMake/CXXModules/FileSetModulesPrivate-stderr.txt deleted file mode 100644 index a6e778a4271..00000000000 --- a/Tests/RunCMake/CXXModules/FileSetModulesPrivate-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Warning \(dev\) at FileSetModulesPrivate.cmake:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/FileSetModulesPublic-stderr.txt b/Tests/RunCMake/CXXModules/FileSetModulesPublic-stderr.txt deleted file mode 100644 index 7fa8aa4e845..00000000000 --- a/Tests/RunCMake/CXXModules/FileSetModulesPublic-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Warning \(dev\) at FileSetModulesPublic.cmake:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/InstallBMI-stderr.txt b/Tests/RunCMake/CXXModules/InstallBMI-stderr.txt deleted file mode 100644 index 0f50963b1fb..00000000000 --- a/Tests/RunCMake/CXXModules/InstallBMI-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Warning \(dev\) at InstallBMI.cmake:[0-9]+ \(install\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/InstallBMIGenericArgs-stderr.txt b/Tests/RunCMake/CXXModules/InstallBMIGenericArgs-stderr.txt deleted file mode 100644 index 52b9c35fea3..00000000000 --- a/Tests/RunCMake/CXXModules/InstallBMIGenericArgs-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Warning \(dev\) at InstallBMIGenericArgs.cmake:[0-9]+ \(install\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/InstallBMIIgnore-stderr.txt b/Tests/RunCMake/CXXModules/InstallBMIIgnore-stderr.txt deleted file mode 100644 index bfff34cf423..00000000000 --- a/Tests/RunCMake/CXXModules/InstallBMIIgnore-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Warning \(dev\) at InstallBMIIgnore.cmake:[0-9]+ \(install\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/NinjaDependInfoBMIInstall-stderr.txt b/Tests/RunCMake/CXXModules/NinjaDependInfoBMIInstall-stderr.txt deleted file mode 100644 index e5bd1ec0890..00000000000 --- a/Tests/RunCMake/CXXModules/NinjaDependInfoBMIInstall-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Warning \(dev\) at NinjaDependInfoBMIInstall.cmake:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/NinjaDependInfoExport-stderr.txt b/Tests/RunCMake/CXXModules/NinjaDependInfoExport-stderr.txt deleted file mode 100644 index ce0e55a3294..00000000000 --- a/Tests/RunCMake/CXXModules/NinjaDependInfoExport-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Warning \(dev\) at NinjaDependInfoExport.cmake:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/NinjaDependInfoFileSet-stderr.txt b/Tests/RunCMake/CXXModules/NinjaDependInfoFileSet-stderr.txt deleted file mode 100644 index 055e741ba03..00000000000 --- a/Tests/RunCMake/CXXModules/NinjaDependInfoFileSet-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -CMake Warning \(dev\) at NinjaDependInfoFileSet.cmake:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/NoCXX-stderr.txt b/Tests/RunCMake/CXXModules/NoCXX-stderr.txt index c261e8c4bb8..5b609a9a577 100644 --- a/Tests/RunCMake/CXXModules/NoCXX-stderr.txt +++ b/Tests/RunCMake/CXXModules/NoCXX-stderr.txt @@ -1,10 +1,3 @@ -CMake Warning \(dev\) at NoCXX.cmake:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. - CMake Error in CMakeLists.txt: The target named "nocxx" has C\+\+ sources that export modules but the "CXX" language has not been enabled diff --git a/Tests/RunCMake/CXXModules/NoCXX20-stderr.txt b/Tests/RunCMake/CXXModules/NoCXX20-stderr.txt index aba0c89412a..4a1641b85c6 100644 --- a/Tests/RunCMake/CXXModules/NoCXX20-stderr.txt +++ b/Tests/RunCMake/CXXModules/NoCXX20-stderr.txt @@ -1,10 +1,3 @@ -CMake Warning \(dev\) at NoCXX20.cmake:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. - CMake Error in CMakeLists.txt: The target named "nocxx20" has C\+\+ sources that export modules but does not include "cxx_std_20" \(or newer\) among its `target_compile_features`; found diff --git a/Tests/RunCMake/CXXModules/NoCXX20ModuleFlag-result.txt b/Tests/RunCMake/CXXModules/NoCXX20ModuleFlag-result.txt deleted file mode 100644 index d00491fd7e5..00000000000 --- a/Tests/RunCMake/CXXModules/NoCXX20ModuleFlag-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/CXXModules/NoCXX20ModuleFlag-stderr.txt b/Tests/RunCMake/CXXModules/NoCXX20ModuleFlag-stderr.txt deleted file mode 100644 index 06174b5c1b6..00000000000 --- a/Tests/RunCMake/CXXModules/NoCXX20ModuleFlag-stderr.txt +++ /dev/null @@ -1,20 +0,0 @@ -CMake Warning \(dev\) at NoCXX20ModuleFlag.cmake:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. - -CMake Error in CMakeLists.txt: - The target named "noexperimentalflag" has C\+\+ sources that export modules - but its experimental support has not been requested - -( -CMake Error in CMakeLists.txt: -( The target named "noexperimentalflag" has C\+\+ sources that export modules - but its experimental support has not been requested -| The target named "noexperimentalflag" contains C\+\+ sources that export - modules which is not supported by the generator -) -)* -CMake Generate step failed. Build files cannot be regenerated correctly. diff --git a/Tests/RunCMake/CXXModules/NoCXX20ModuleFlag.cmake b/Tests/RunCMake/CXXModules/NoCXX20ModuleFlag.cmake deleted file mode 100644 index f6ccb99a6e0..00000000000 --- a/Tests/RunCMake/CXXModules/NoCXX20ModuleFlag.cmake +++ /dev/null @@ -1,14 +0,0 @@ -enable_language(CXX) - -set(CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE "echo") - -add_library(noexperimentalflag) -target_sources(noexperimentalflag - PUBLIC - FILE_SET fs TYPE CXX_MODULES FILES - sources/module.cxx) -target_compile_features(noexperimentalflag - PRIVATE - cxx_std_20) - -unset(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API) diff --git a/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt b/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt index 8d15c19967e..6640c99c3d0 100644 --- a/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt +++ b/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt @@ -1,10 +1,3 @@ -CMake Warning \(dev\) at NoDyndepSupport.cmake:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. - (CMake Error: The Ninja generator does not support C\+\+20 modules using Ninja version diff --git a/Tests/RunCMake/CXXModules/NotCXXSourceModules-stderr.txt b/Tests/RunCMake/CXXModules/NotCXXSourceModules-stderr.txt index d73ff983725..e5f0f0bb47f 100644 --- a/Tests/RunCMake/CXXModules/NotCXXSourceModules-stderr.txt +++ b/Tests/RunCMake/CXXModules/NotCXXSourceModules-stderr.txt @@ -1,10 +1,3 @@ -CMake Warning \(dev\) at NotCXXSourceModules.cmake:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. - CMake Error in CMakeLists.txt: Target "not-cxx-source" contains the source diff --git a/Tests/RunCMake/CXXModules/NotCompiledSourceModules-stderr.txt b/Tests/RunCMake/CXXModules/NotCompiledSourceModules-stderr.txt index c963ce7d755..0af7b937725 100644 --- a/Tests/RunCMake/CXXModules/NotCompiledSourceModules-stderr.txt +++ b/Tests/RunCMake/CXXModules/NotCompiledSourceModules-stderr.txt @@ -1,10 +1,3 @@ -CMake Warning \(dev\) at NotCompiledSourceModules.cmake:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. - (CMake Error in CMakeLists.txt: Target "not-cxx-source" has source file diff --git a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake index f111b7485ec..2f323129432 100644 --- a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake +++ b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake @@ -14,10 +14,6 @@ if ("cxx_std_20" IN_LIST CMAKE_CXX_COMPILE_FEATURES) if (NOT forced_cxx_standard) run_cmake(NoCXX20) endif () - - # This test uses C++20, but another prerequisite is missing, so forced - # standards don't matter. - run_cmake(NoCXX20ModuleFlag) endif () if (RunCMake_GENERATOR MATCHES "Ninja") diff --git a/Tests/RunCMake/CXXModules/examples/circular-stderr.txt b/Tests/RunCMake/CXXModules/examples/circular-stderr.txt deleted file mode 100644 index be89b8c2665..00000000000 --- a/Tests/RunCMake/CXXModules/examples/circular-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake b/Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake index 5f32364f8d7..da3c21516df 100644 --- a/Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake +++ b/Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake @@ -1,5 +1,3 @@ -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "ac01f462-0f5f-432a-86aa-acef252918a6") - if (NOT EXISTS "${CMake_TEST_MODULE_COMPILATION_RULES}") message(FATAL_ERROR "The `CMake_TEST_MODULE_COMPILATION_RULES` file must be specified " diff --git a/Tests/RunCMake/CXXModules/examples/deep-chain-stderr.txt b/Tests/RunCMake/CXXModules/examples/deep-chain-stderr.txt deleted file mode 100644 index be89b8c2665..00000000000 --- a/Tests/RunCMake/CXXModules/examples/deep-chain-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/duplicate-stderr.txt b/Tests/RunCMake/CXXModules/examples/duplicate-stderr.txt deleted file mode 100644 index be89b8c2665..00000000000 --- a/Tests/RunCMake/CXXModules/examples/duplicate-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build-stderr.txt b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build-stderr.txt deleted file mode 100644 index be89b8c2665..00000000000 --- a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. 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 c17577cb89a..e23cefecd5b 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,8 +1,6 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "ac01f462-0f5f-432a-86aa-acef252918a6") - find_package(export_bmi_and_interfaces REQUIRED) if (NOT TARGET CXXModules::export_bmi_and_interfaces) diff --git a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install-stderr.txt b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install-stderr.txt deleted file mode 100644 index be89b8c2665..00000000000 --- a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. 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 d608d67a928..eb6c19cd6fe 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,8 +1,6 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "ac01f462-0f5f-432a-86aa-acef252918a6") - find_package(export_bmi_and_interfaces REQUIRED) if (NOT TARGET CXXModules::export_bmi_and_interfaces) diff --git a/Tests/RunCMake/CXXModules/examples/export-compile-commands-stderr.txt b/Tests/RunCMake/CXXModules/examples/export-compile-commands-stderr.txt deleted file mode 100644 index be89b8c2665..00000000000 --- a/Tests/RunCMake/CXXModules/examples/export-compile-commands-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-build-stderr.txt b/Tests/RunCMake/CXXModules/examples/export-include-directories-build-stderr.txt deleted file mode 100644 index 28a7b1f46a4..00000000000 --- a/Tests/RunCMake/CXXModules/examples/export-include-directories-build-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9] \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-install-stderr.txt b/Tests/RunCMake/CXXModules/examples/export-include-directories-install-stderr.txt deleted file mode 100644 index be89b8c2665..00000000000 --- a/Tests/RunCMake/CXXModules/examples/export-include-directories-install-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-build-stderr.txt b/Tests/RunCMake/CXXModules/examples/export-interface-build-stderr.txt deleted file mode 100644 index 28a7b1f46a4..00000000000 --- a/Tests/RunCMake/CXXModules/examples/export-interface-build-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9] \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. 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 106bd1e1b04..2e6d6030351 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt @@ -1,8 +1,6 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "ac01f462-0f5f-432a-86aa-acef252918a6") - find_package(export_interfaces REQUIRED) if (NOT TARGET CXXModules::export_interfaces) diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-install-stderr.txt b/Tests/RunCMake/CXXModules/examples/export-interface-install-stderr.txt deleted file mode 100644 index be89b8c2665..00000000000 --- a/Tests/RunCMake/CXXModules/examples/export-interface-install-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. 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 c19283b750d..a2c51b0c934 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt @@ -1,8 +1,6 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "ac01f462-0f5f-432a-86aa-acef252918a6") - find_package(export_interfaces REQUIRED) if (NOT TARGET CXXModules::export_interfaces) diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build-stderr.txt b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build-stderr.txt deleted file mode 100644 index be89b8c2665..00000000000 --- a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt index fba05f49949..4b4fe043ded 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt @@ -1,8 +1,6 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "ac01f462-0f5f-432a-86aa-acef252918a6") - find_package(export_interfaces_no_properties REQUIRED) if (NOT TARGET CXXModules::export_interfaces_no_properties) diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install-stderr.txt b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install-stderr.txt deleted file mode 100644 index be89b8c2665..00000000000 --- a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt index fba05f49949..4b4fe043ded 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt @@ -1,8 +1,6 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "ac01f462-0f5f-432a-86aa-acef252918a6") - find_package(export_interfaces_no_properties REQUIRED) if (NOT TARGET CXXModules::export_interfaces_no_properties) diff --git a/Tests/RunCMake/CXXModules/examples/export-usage-build-stderr.txt b/Tests/RunCMake/CXXModules/examples/export-usage-build-stderr.txt deleted file mode 100644 index be89b8c2665..00000000000 --- a/Tests/RunCMake/CXXModules/examples/export-usage-build-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/export-usage-build/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-usage-build/test/CMakeLists.txt index adec9e7aee9..4a6728b50d2 100644 --- a/Tests/RunCMake/CXXModules/examples/export-usage-build/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-usage-build/test/CMakeLists.txt @@ -1,8 +1,6 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "ac01f462-0f5f-432a-86aa-acef252918a6") - find_package(export_usage REQUIRED) if (NOT TARGET CXXModules::export_usage) diff --git a/Tests/RunCMake/CXXModules/examples/export-usage-install-stderr.txt b/Tests/RunCMake/CXXModules/examples/export-usage-install-stderr.txt deleted file mode 100644 index be89b8c2665..00000000000 --- a/Tests/RunCMake/CXXModules/examples/export-usage-install-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/export-usage-install/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-usage-install/test/CMakeLists.txt index 9ccd63a32d5..28ff3bd5ea9 100644 --- a/Tests/RunCMake/CXXModules/examples/export-usage-install/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-usage-install/test/CMakeLists.txt @@ -1,8 +1,6 @@ cmake_minimum_required(VERSION 3.24) project(cxx_modules_library NONE) -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "ac01f462-0f5f-432a-86aa-acef252918a6") - find_package(export_usage REQUIRED) if (NOT TARGET CXXModules::export_usage) diff --git a/Tests/RunCMake/CXXModules/examples/generated-stderr.txt b/Tests/RunCMake/CXXModules/examples/generated-stderr.txt deleted file mode 100644 index be89b8c2665..00000000000 --- a/Tests/RunCMake/CXXModules/examples/generated-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/import-modules-export-bmi-and-interface-build-stderr.txt b/Tests/RunCMake/CXXModules/examples/import-modules-export-bmi-and-interface-build-stderr.txt deleted file mode 100644 index e2970ec16ae..00000000000 --- a/Tests/RunCMake/CXXModules/examples/import-modules-export-bmi-and-interface-build-stderr.txt +++ /dev/null @@ -1,7 +0,0 @@ -CMake Warning \(dev\) at .*/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build-build/export_bmi_and_interfaces-targets.cmake:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - .*/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build-build/export_bmi_and_interfaces-config.cmake:[0-9]+ \(include\) - CMakeLists.txt:[0-9]+ \(find_package\) -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/import-modules-export-bmi-and-interface-install-stderr.txt b/Tests/RunCMake/CXXModules/examples/import-modules-export-bmi-and-interface-install-stderr.txt deleted file mode 100644 index ec5dd1feff1..00000000000 --- a/Tests/RunCMake/CXXModules/examples/import-modules-export-bmi-and-interface-install-stderr.txt +++ /dev/null @@ -1,7 +0,0 @@ -CMake Warning \(dev\) at .*/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install-install/lib/cmake/export_bmi_and_interfaces/export_bmi_and_interfaces-targets.cmake:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - .*/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install-install/lib/cmake/export_bmi_and_interfaces/export_bmi_and_interfaces-config.cmake:[0-9]+ \(include\) - CMakeLists.txt:[0-9]+ \(find_package\) -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/import-modules-export-include-directories-build-stderr.txt b/Tests/RunCMake/CXXModules/examples/import-modules-export-include-directories-build-stderr.txt deleted file mode 100644 index 4ea3679607c..00000000000 --- a/Tests/RunCMake/CXXModules/examples/import-modules-export-include-directories-build-stderr.txt +++ /dev/null @@ -1,7 +0,0 @@ -CMake Warning \(dev\) at .*/Tests/RunCMake/CXXModules/examples/export-include-directories-build-build/export_include_directories-targets.cmake:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - .*/Tests/RunCMake/CXXModules/examples/export-include-directories-build-build/export_include_directories-config.cmake:[0-9]+ \(include\) - CMakeLists.txt:[0-9]+ \(find_package\) -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/import-modules-export-include-directories-install-stderr.txt b/Tests/RunCMake/CXXModules/examples/import-modules-export-include-directories-install-stderr.txt deleted file mode 100644 index 50ad6b9ef81..00000000000 --- a/Tests/RunCMake/CXXModules/examples/import-modules-export-include-directories-install-stderr.txt +++ /dev/null @@ -1,7 +0,0 @@ -CMake Warning \(dev\) at .*/Tests/RunCMake/CXXModules/examples/export-include-directories-install-install/lib/cmake/export_include_directories/export_include_directories-targets.cmake:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - .*/Tests/RunCMake/CXXModules/examples/export-include-directories-install-install/lib/cmake/export_include_directories/export_include_directories-config.cmake:[0-9]+ \(include\) - CMakeLists.txt:[0-9]+ \(find_package\) -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-build-stderr.txt b/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-build-stderr.txt deleted file mode 100644 index 10404c62063..00000000000 --- a/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-build-stderr.txt +++ /dev/null @@ -1,7 +0,0 @@ -CMake Warning \(dev\) at .*/Tests/RunCMake/CXXModules/examples/export-interface-build-build/export_interfaces-targets.cmake:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - .*/Tests/RunCMake/CXXModules/examples/export-interface-build-build/export_interfaces-config.cmake:[0-9]+ \(include\) - CMakeLists.txt:[0-9]+ \(find_package\) -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-install-stderr.txt b/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-install-stderr.txt deleted file mode 100644 index 04124cd92af..00000000000 --- a/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-install-stderr.txt +++ /dev/null @@ -1,7 +0,0 @@ -CMake Warning \(dev\) at .*/Tests/RunCMake/CXXModules/examples/export-interface-install-install/lib/cmake/export_interfaces/export_interfaces-targets.cmake:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - .*/Tests/RunCMake/CXXModules/examples/export-interface-install-install/lib/cmake/export_interfaces/export_interfaces-config.cmake:[0-9]+ \(include\) - CMakeLists.txt:[0-9]+ \(find_package\) -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-no-properties-build-stderr.txt b/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-no-properties-build-stderr.txt deleted file mode 100644 index dcf64982580..00000000000 --- a/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-no-properties-build-stderr.txt +++ /dev/null @@ -1,7 +0,0 @@ -CMake Warning \(dev\) at .*/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build-build/export_interfaces_no_properties-targets.cmake:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - .*/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build-build/export_interfaces_no_properties-config.cmake:[0-9]+ \(include\) - CMakeLists.txt:[0-9]+ \(find_package\) -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-no-properties-install-stderr.txt b/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-no-properties-install-stderr.txt deleted file mode 100644 index 7073b4ad00a..00000000000 --- a/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-no-properties-install-stderr.txt +++ /dev/null @@ -1,7 +0,0 @@ -CMake Warning \(dev\) at .*/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install-install/lib/cmake/export_interfaces_no_properties/export_interfaces_no_properties-targets.cmake:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - .*/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install-install/lib/cmake/export_interfaces_no_properties/export_interfaces_no_properties-config.cmake:[0-9]+ \(include\) - CMakeLists.txt:[0-9]+ \(find_package\) -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/install-bmi-and-interfaces-stderr.txt b/Tests/RunCMake/CXXModules/examples/install-bmi-and-interfaces-stderr.txt deleted file mode 100644 index be89b8c2665..00000000000 --- a/Tests/RunCMake/CXXModules/examples/install-bmi-and-interfaces-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/install-bmi-stderr.txt b/Tests/RunCMake/CXXModules/examples/install-bmi-stderr.txt deleted file mode 100644 index be89b8c2665..00000000000 --- a/Tests/RunCMake/CXXModules/examples/install-bmi-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/internal-partitions-stderr.txt b/Tests/RunCMake/CXXModules/examples/internal-partitions-stderr.txt deleted file mode 100644 index be89b8c2665..00000000000 --- a/Tests/RunCMake/CXXModules/examples/internal-partitions-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/library-shared-stderr.txt b/Tests/RunCMake/CXXModules/examples/library-shared-stderr.txt deleted file mode 100644 index be89b8c2665..00000000000 --- a/Tests/RunCMake/CXXModules/examples/library-shared-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/library-static-stderr.txt b/Tests/RunCMake/CXXModules/examples/library-static-stderr.txt deleted file mode 100644 index be89b8c2665..00000000000 --- a/Tests/RunCMake/CXXModules/examples/library-static-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/object-library-stderr.txt b/Tests/RunCMake/CXXModules/examples/object-library-stderr.txt deleted file mode 100644 index be89b8c2665..00000000000 --- a/Tests/RunCMake/CXXModules/examples/object-library-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/partitions-stderr.txt b/Tests/RunCMake/CXXModules/examples/partitions-stderr.txt deleted file mode 100644 index be89b8c2665..00000000000 --- a/Tests/RunCMake/CXXModules/examples/partitions-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/public-req-private-stderr.txt b/Tests/RunCMake/CXXModules/examples/public-req-private-stderr.txt deleted file mode 100644 index be89b8c2665..00000000000 --- a/Tests/RunCMake/CXXModules/examples/public-req-private-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/req-private-other-target-stderr.txt b/Tests/RunCMake/CXXModules/examples/req-private-other-target-stderr.txt deleted file mode 100644 index be89b8c2665..00000000000 --- a/Tests/RunCMake/CXXModules/examples/req-private-other-target-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/same-src-name-stderr.txt b/Tests/RunCMake/CXXModules/examples/same-src-name-stderr.txt deleted file mode 100644 index be89b8c2665..00000000000 --- a/Tests/RunCMake/CXXModules/examples/same-src-name-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/scan_properties-stderr.txt b/Tests/RunCMake/CXXModules/examples/scan_properties-stderr.txt deleted file mode 100644 index be89b8c2665..00000000000 --- a/Tests/RunCMake/CXXModules/examples/scan_properties-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/simple-stderr.txt b/Tests/RunCMake/CXXModules/examples/simple-stderr.txt deleted file mode 100644 index be89b8c2665..00000000000 --- a/Tests/RunCMake/CXXModules/examples/simple-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/try-compile-stderr.txt b/Tests/RunCMake/CXXModules/examples/try-compile-stderr.txt deleted file mode 100644 index a121e869f64..00000000000 --- a/Tests/RunCMake/CXXModules/examples/try-compile-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(try_compile\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/try-run-stderr.txt b/Tests/RunCMake/CXXModules/examples/try-run-stderr.txt deleted file mode 100644 index 8eea7a6f98c..00000000000 --- a/Tests/RunCMake/CXXModules/examples/try-run-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(try_run\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json index 28f2b993315..22dfabdce01 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json @@ -51,6 +51,40 @@ } ] }, + { + "component": "Unspecified", + "type": "cxxModuleBmi", + "destination": "lib", + "paths": null, + "isExcludeFromAll": null, + "isForAllComponents": null, + "isOptional": null, + "targetId": null, + "targetIndex": null, + "cxxModuleBmiTarget": { + "id": "^cxx_exe::@a56b12a3f5c0529fb296", + "index": "cxx_exe" + }, + "targetIsImportLibrary": null, + "targetInstallNamelink": null, + "exportName": null, + "exportTargets": null, + "scriptFile": null, + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 38, + "command": "install", + "hasParent": true + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, { "component": "Unspecified", "type": "runtimeDependencySet", diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/object.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/object.json index 44bc72545d6..48c3a9d1720 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/object.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/object.json @@ -47,6 +47,40 @@ } ] }, + { + "component": "Unspecified", + "type": "cxxModuleBmi", + "destination": "bin", + "paths": null, + "isExcludeFromAll": null, + "isForAllComponents": null, + "isOptional": null, + "targetId": null, + "targetIndex": null, + "cxxModuleBmiTarget": { + "id": "^c_object_exe::@5ed5358f70faf8d8af7a$", + "index": "c_object_exe" + }, + "targetIsImportLibrary": null, + "targetInstallNamelink": null, + "exportName": null, + "exportTargets": null, + "scriptFile": null, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 13, + "command": "install", + "hasParent": true + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, { "component": "Unspecified", "type": "target", @@ -78,6 +112,40 @@ "hasParent": false } ] + }, + { + "component": "Unspecified", + "type": "cxxModuleBmi", + "destination": "bin", + "paths": null, + "isExcludeFromAll": null, + "isForAllComponents": null, + "isOptional": null, + "targetId": null, + "targetIndex": null, + "cxxModuleBmiTarget": { + "id": "^cxx_object_exe::@5ed5358f70faf8d8af7a$", + "index": "cxx_object_exe" + }, + "targetIsImportLibrary": null, + "targetInstallNamelink": null, + "exportName": null, + "exportTargets": null, + "scriptFile": null, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 13, + "command": "install", + "hasParent": true + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] } ] } diff --git a/Tests/RunCMake/target_sources/FileSetDefaultWrongType-stderr.txt b/Tests/RunCMake/target_sources/FileSetDefaultWrongType-stderr.txt index faf0f5a33bb..c13c8a8aa98 100644 --- a/Tests/RunCMake/target_sources/FileSetDefaultWrongType-stderr.txt +++ b/Tests/RunCMake/target_sources/FileSetDefaultWrongType-stderr.txt @@ -1,4 +1,4 @@ ^CMake Error at FileSetDefaultWrongType\.cmake:[0-9]+ \(target_sources\): - target_sources File set TYPE may only be "HEADERS" + target_sources File set TYPE may only be "HEADERS" or "CXX_MODULES" Call Stack \(most recent call first\): CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental-result.txt b/Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental-result.txt deleted file mode 100644 index d00491fd7e5..00000000000 --- a/Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental-stderr.txt b/Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental-stderr.txt deleted file mode 100644 index 5356b0745f0..00000000000 --- a/Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental-stderr.txt +++ /dev/null @@ -1,11 +0,0 @@ -^CMake Warning \(dev\) at FileSetDefaultWrongTypeExperimental.cmake:6 \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. - -CMake Error at FileSetDefaultWrongTypeExperimental\.cmake:[0-9]+ \(target_sources\): - target_sources File set TYPE may only be "HEADERS" or "CXX_MODULES" -Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental.cmake b/Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental.cmake deleted file mode 100644 index 9a8429dfa54..00000000000 --- a/Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental.cmake +++ /dev/null @@ -1,6 +0,0 @@ -enable_language(C) - -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "ac01f462-0f5f-432a-86aa-acef252918a6") - -add_library(lib1 STATIC empty.c) -target_sources(lib1 PRIVATE FILE_SET UNKNOWN) diff --git a/Tests/RunCMake/target_sources/FileSetWrongType-stderr.txt b/Tests/RunCMake/target_sources/FileSetWrongType-stderr.txt index 8ffa786183d..9cc764fa87e 100644 --- a/Tests/RunCMake/target_sources/FileSetWrongType-stderr.txt +++ b/Tests/RunCMake/target_sources/FileSetWrongType-stderr.txt @@ -1,4 +1,4 @@ ^CMake Error at FileSetWrongType\.cmake:[0-9]+ \(target_sources\): - target_sources File set TYPE may only be "HEADERS" + target_sources File set TYPE may only be "HEADERS" or "CXX_MODULES" Call Stack \(most recent call first\): CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/target_sources/FileSetWrongTypeExperimental-result.txt b/Tests/RunCMake/target_sources/FileSetWrongTypeExperimental-result.txt deleted file mode 100644 index d00491fd7e5..00000000000 --- a/Tests/RunCMake/target_sources/FileSetWrongTypeExperimental-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/target_sources/FileSetWrongTypeExperimental-stderr.txt b/Tests/RunCMake/target_sources/FileSetWrongTypeExperimental-stderr.txt deleted file mode 100644 index 5c750003ebb..00000000000 --- a/Tests/RunCMake/target_sources/FileSetWrongTypeExperimental-stderr.txt +++ /dev/null @@ -1,11 +0,0 @@ -^CMake Warning \(dev\) at FileSetWrongTypeExperimental.cmake:6 \(target_sources\): - CMake's C\+\+ module support is experimental. It is meant only for - experimentation and feedback to CMake developers. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. - -CMake Error at FileSetWrongTypeExperimental\.cmake:[0-9]+ \(target_sources\): - target_sources File set TYPE may only be "HEADERS" or "CXX_MODULES" -Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/target_sources/FileSetWrongTypeExperimental.cmake b/Tests/RunCMake/target_sources/FileSetWrongTypeExperimental.cmake deleted file mode 100644 index f63308c92ce..00000000000 --- a/Tests/RunCMake/target_sources/FileSetWrongTypeExperimental.cmake +++ /dev/null @@ -1,6 +0,0 @@ -enable_language(C) - -set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "ac01f462-0f5f-432a-86aa-acef252918a6") - -add_library(lib1 STATIC empty.c) -target_sources(lib1 PRIVATE FILE_SET a TYPE UNKNOWN) diff --git a/Tests/RunCMake/target_sources/RunCMakeTest.cmake b/Tests/RunCMake/target_sources/RunCMakeTest.cmake index 8505f71d79d..4d3d4fe12cf 100644 --- a/Tests/RunCMake/target_sources/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_sources/RunCMakeTest.cmake @@ -27,8 +27,6 @@ run_cmake(FileSetProperties) run_cmake(FileSetNoType) run_cmake(FileSetWrongType) run_cmake(FileSetDefaultWrongType) -run_cmake(FileSetWrongTypeExperimental) -run_cmake(FileSetDefaultWrongTypeExperimental) run_cmake(FileSetChangeScope) run_cmake(FileSetChangeType) run_cmake(FileSetWrongBaseDirs) -- GitLab From ff18acc3018002fc29c24d7f60485800534ab592 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 21 Sep 2023 16:04:29 -0400 Subject: [PATCH 3/8] CXXModules: remove `EXPERIMENTAL` from C++ module variable names --- Modules/Compiler/Clang-CXX.cmake | 8 ++++---- Modules/Compiler/GNU-CXX.cmake | 8 ++++---- Modules/Compiler/MSVC-CXX.cmake | 10 +++++----- Source/cmNinjaTargetGenerator.cxx | 20 +++++++++---------- .../CXXModules/ExportBuildCxxModules.cmake | 2 +- .../CXXModules/ExportInstallCxxModules.cmake | 2 +- .../CXXModules/FileSetModulesPrivate.cmake | 2 +- .../CXXModules/FileSetModulesPublic.cmake | 2 +- .../NinjaDependInfoBMIInstall.cmake | 2 +- .../CXXModules/NinjaDependInfoExport.cmake | 2 +- .../CXXModules/NinjaDependInfoFileSet.cmake | 2 +- .../RunCMake/CXXModules/NoDyndepSupport.cmake | 2 +- .../CXXModules/NotCXXSourceModules.cmake | 2 +- .../CXXModules/NotCompiledSourceModules.cmake | 2 +- .../examples/scan_properties/CMakeLists.txt | 4 ++-- 15 files changed, 35 insertions(+), 35 deletions(-) diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake index 1167ba8afd8..c0d23564fa8 100644 --- a/Modules/Compiler/Clang-CXX.cmake +++ b/Modules/Compiler/Clang-CXX.cmake @@ -32,7 +32,7 @@ endif() if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0) if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU") - string(CONCAT CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE + string(CONCAT CMAKE_CXX_SCANDEP_SOURCE "\"${CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS}\"" " -format=p1689" " --" @@ -41,8 +41,8 @@ if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0) " -MT " " -MD -MF " " > ") - set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FORMAT "clang") - set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FLAG "@") - set(CMAKE_EXPERIMENTAL_CXX_MODULE_BMI_ONLY_FLAG "--precompile") + set(CMAKE_CXX_MODULE_MAP_FORMAT "clang") + set(CMAKE_CXX_MODULE_MAP_FLAG "@") + set(CMAKE_CXX_MODULE_BMI_ONLY_FLAG "--precompile") endif() endif() diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index c276f4ef54a..2e1b4ade840 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -74,13 +74,13 @@ 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 + string(CONCAT CMAKE_CXX_SCANDEP_SOURCE " -E -x c++ " " -MT -MD -MF " " -fmodules-ts -fdeps-file= -fdeps-target= -fdeps-format=p1689r5" " -o ") - set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FORMAT "gcc") - string(CONCAT CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FLAG + set(CMAKE_CXX_MODULE_MAP_FORMAT "gcc") + string(CONCAT CMAKE_CXX_MODULE_MAP_FLAG # Turn on modules. "-fmodules-ts" # Read the module mapper file. @@ -91,5 +91,5 @@ if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 14.0) " -fdeps-format=p1689r5" # Force C++ as a language. " -x c++") - set(CMAKE_EXPERIMENTAL_CXX_MODULE_BMI_ONLY_FLAG "-fmodule-only") + set(CMAKE_CXX_MODULE_BMI_ONLY_FLAG "-fmodule-only") endif() diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake index b03f826bffc..79cd2e082f1 100644 --- a/Modules/Compiler/MSVC-CXX.cmake +++ b/Modules/Compiler/MSVC-CXX.cmake @@ -79,13 +79,13 @@ elseif (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0) endif() if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "19.34") - string(CONCAT CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE + string(CONCAT CMAKE_CXX_SCANDEP_SOURCE " -nologo -TP" " -showIncludes" " -scanDependencies " " -Fo") - set(CMAKE_EXPERIMENTAL_CXX_SCANDEP_DEPFILE_FORMAT "msvc") - set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FORMAT "msvc") - set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FLAG "@") - set(CMAKE_EXPERIMENTAL_CXX_MODULE_BMI_ONLY_FLAG "-ifcOnly;-ifcOutput;") + set(CMAKE_CXX_SCANDEP_DEPFILE_FORMAT "msvc") + set(CMAKE_CXX_MODULE_MAP_FORMAT "msvc") + set(CMAKE_CXX_MODULE_MAP_FLAG "@") + set(CMAKE_CXX_MODULE_BMI_ONLY_FLAG "-ifcOnly;-ifcOutput;") endif () diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 193cc0f5b51..5d4397b4824 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -266,7 +266,7 @@ std::string cmNinjaTargetGenerator::ComputeFlagsForObject( if (!this->GeneratorTarget->Target->IsNormal()) { auto flag = this->GetMakefile()->GetSafeDefinition( - "CMAKE_EXPERIMENTAL_CXX_MODULE_BMI_ONLY_FLAG"); + "CMAKE_CXX_MODULE_BMI_ONLY_FLAG"); cmRulePlaceholderExpander::RuleVariables compileObjectVars; compileObjectVars.Object = objectFileName.c_str(); auto rulePlaceholderExpander = @@ -710,7 +710,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang, } } std::string const modmapFormatVar = - cmStrCat("CMAKE_EXPERIMENTAL_", lang, "_MODULE_MAP_FORMAT"); + cmStrCat("CMAKE_", lang, "_MODULE_MAP_FORMAT"); std::string const modmapFormat = this->Makefile->GetSafeDefinition(modmapFormatVar); @@ -734,7 +734,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang, if (withScanning == WithScanning::Yes) { const auto& scanDepType = this->GetMakefile()->GetSafeDefinition( - cmStrCat("CMAKE_EXPERIMENTAL_", lang, "_SCANDEP_DEPFILE_FORMAT")); + cmStrCat("CMAKE_", lang, "_SCANDEP_DEPFILE_FORMAT")); // Rule to scan dependencies of sources that need preprocessing. { @@ -745,7 +745,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang, scanRuleName = this->LanguageScanRule(lang, config); ppFileName = "$PREPROCESSED_OUTPUT_FILE"; std::string const& scanCommand = mf->GetRequiredDefinition( - cmStrCat("CMAKE_EXPERIMENTAL_", lang, "_SCANDEP_SOURCE")); + cmStrCat("CMAKE_", lang, "_SCANDEP_SOURCE")); scanCommands.assign(scanCommand); for (auto& i : scanCommands) { i = cmStrCat(launcher, i); @@ -893,8 +893,8 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang, } if (withScanning == WithScanning::Yes && !modmapFormat.empty()) { - std::string modmapFlags = mf->GetRequiredDefinition( - cmStrCat("CMAKE_EXPERIMENTAL_", lang, "_MODULE_MAP_FLAG")); + std::string modmapFlags = + mf->GetRequiredDefinition(cmStrCat("CMAKE_", lang, "_MODULE_MAP_FLAG")); cmSystemTools::ReplaceString(modmapFlags, "", "$DYNDEP_MODULE_MAP_FILE"); flags += cmStrCat(' ', modmapFlags); @@ -1477,7 +1477,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( std::string modmapFormat; if (needDyndep) { std::string const modmapFormatVar = - cmStrCat("CMAKE_EXPERIMENTAL_", language, "_MODULE_MAP_FORMAT"); + cmStrCat("CMAKE_", language, "_MODULE_MAP_FORMAT"); modmapFormat = this->Makefile->GetSafeDefinition(modmapFormatVar); } @@ -1758,7 +1758,7 @@ void cmNinjaTargetGenerator::WriteCxxModuleBmiBuildStatement( std::string modmapFormat; if (true) { std::string const modmapFormatVar = - cmStrCat("CMAKE_EXPERIMENTAL_", language, "_MODULE_MAP_FORMAT"); + cmStrCat("CMAKE_", language, "_MODULE_MAP_FORMAT"); modmapFormat = this->Makefile->GetSafeDefinition(modmapFormatVar); } @@ -1969,12 +1969,12 @@ void cmNinjaTargetGenerator::ExportObjectCompileCommand( bool const needDyndep = this->GetGeneratorTarget()->NeedDyndep(language, outputConfig); std::string const modmapFormatVar = - cmStrCat("CMAKE_EXPERIMENTAL_", language, "_MODULE_MAP_FORMAT"); + cmStrCat("CMAKE_", language, "_MODULE_MAP_FORMAT"); std::string const modmapFormat = this->Makefile->GetSafeDefinition(modmapFormatVar); if (needDyndep && !modmapFormat.empty()) { std::string modmapFlags = this->GetMakefile()->GetRequiredDefinition( - cmStrCat("CMAKE_EXPERIMENTAL_", language, "_MODULE_MAP_FLAG")); + cmStrCat("CMAKE_", language, "_MODULE_MAP_FLAG")); // XXX(modmap): If changing this path construction, change // `cmGlobalNinjaGenerator::WriteDyndep` and // `cmNinjaTargetGenerator::WriteObjectBuildStatement` to expect the diff --git a/Tests/RunCMake/CXXModules/ExportBuildCxxModules.cmake b/Tests/RunCMake/CXXModules/ExportBuildCxxModules.cmake index eb3a49c885c..8cee83eda10 100644 --- a/Tests/RunCMake/CXXModules/ExportBuildCxxModules.cmake +++ b/Tests/RunCMake/CXXModules/ExportBuildCxxModules.cmake @@ -1,5 +1,5 @@ enable_language(CXX) -set(CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE "") +set(CMAKE_CXX_SCANDEP_SOURCE "") add_library(export-modules) target_sources(export-modules diff --git a/Tests/RunCMake/CXXModules/ExportInstallCxxModules.cmake b/Tests/RunCMake/CXXModules/ExportInstallCxxModules.cmake index b4cb3768ad1..24a32a6cff8 100644 --- a/Tests/RunCMake/CXXModules/ExportInstallCxxModules.cmake +++ b/Tests/RunCMake/CXXModules/ExportInstallCxxModules.cmake @@ -1,5 +1,5 @@ enable_language(CXX) -set(CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE "") +set(CMAKE_CXX_SCANDEP_SOURCE "") add_library(export-modules) target_sources(export-modules diff --git a/Tests/RunCMake/CXXModules/FileSetModulesPrivate.cmake b/Tests/RunCMake/CXXModules/FileSetModulesPrivate.cmake index 198ae150d3e..83bbd4d1123 100644 --- a/Tests/RunCMake/CXXModules/FileSetModulesPrivate.cmake +++ b/Tests/RunCMake/CXXModules/FileSetModulesPrivate.cmake @@ -1,5 +1,5 @@ enable_language(CXX) -set(CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE "") +set(CMAKE_CXX_SCANDEP_SOURCE "") add_library(module) target_sources(module diff --git a/Tests/RunCMake/CXXModules/FileSetModulesPublic.cmake b/Tests/RunCMake/CXXModules/FileSetModulesPublic.cmake index 904e42e8f4a..52ba35f5e28 100644 --- a/Tests/RunCMake/CXXModules/FileSetModulesPublic.cmake +++ b/Tests/RunCMake/CXXModules/FileSetModulesPublic.cmake @@ -1,5 +1,5 @@ enable_language(CXX) -set(CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE "") +set(CMAKE_CXX_SCANDEP_SOURCE "") add_library(module) target_sources(module diff --git a/Tests/RunCMake/CXXModules/NinjaDependInfoBMIInstall.cmake b/Tests/RunCMake/CXXModules/NinjaDependInfoBMIInstall.cmake index 9f8e51a0d72..fd8fd25fc9c 100644 --- a/Tests/RunCMake/CXXModules/NinjaDependInfoBMIInstall.cmake +++ b/Tests/RunCMake/CXXModules/NinjaDependInfoBMIInstall.cmake @@ -1,6 +1,6 @@ # Fake out that we have dyndep; we only need to generate, not actually build # here. -set(CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE "") +set(CMAKE_CXX_SCANDEP_SOURCE "") enable_language(CXX) diff --git a/Tests/RunCMake/CXXModules/NinjaDependInfoExport.cmake b/Tests/RunCMake/CXXModules/NinjaDependInfoExport.cmake index 0b09d23149f..a224ecaaf03 100644 --- a/Tests/RunCMake/CXXModules/NinjaDependInfoExport.cmake +++ b/Tests/RunCMake/CXXModules/NinjaDependInfoExport.cmake @@ -1,6 +1,6 @@ # Fake out that we have dyndep; we only need to generate, not actually build # here. -set(CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE "") +set(CMAKE_CXX_SCANDEP_SOURCE "") enable_language(CXX) diff --git a/Tests/RunCMake/CXXModules/NinjaDependInfoFileSet.cmake b/Tests/RunCMake/CXXModules/NinjaDependInfoFileSet.cmake index b50be990904..77351bfa646 100644 --- a/Tests/RunCMake/CXXModules/NinjaDependInfoFileSet.cmake +++ b/Tests/RunCMake/CXXModules/NinjaDependInfoFileSet.cmake @@ -1,6 +1,6 @@ # Fake out that we have dyndep; we only need to generate, not actually build # here. -set(CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE "") +set(CMAKE_CXX_SCANDEP_SOURCE "") enable_language(CXX) diff --git a/Tests/RunCMake/CXXModules/NoDyndepSupport.cmake b/Tests/RunCMake/CXXModules/NoDyndepSupport.cmake index 71d0f261ca2..6e2d94b1acd 100644 --- a/Tests/RunCMake/CXXModules/NoDyndepSupport.cmake +++ b/Tests/RunCMake/CXXModules/NoDyndepSupport.cmake @@ -1,5 +1,5 @@ enable_language(CXX) -set(CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE "") +set(CMAKE_CXX_SCANDEP_SOURCE "") if (NOT CMAKE_CXX_STANDARD_DEFAULT) set(CMAKE_CXX_STANDARD_DEFAULT "11") diff --git a/Tests/RunCMake/CXXModules/NotCXXSourceModules.cmake b/Tests/RunCMake/CXXModules/NotCXXSourceModules.cmake index c4e039f1a79..f802cb70395 100644 --- a/Tests/RunCMake/CXXModules/NotCXXSourceModules.cmake +++ b/Tests/RunCMake/CXXModules/NotCXXSourceModules.cmake @@ -1,6 +1,6 @@ enable_language(C) enable_language(CXX) -set(CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE "") +set(CMAKE_CXX_SCANDEP_SOURCE "") add_library(not-cxx-source) target_sources(not-cxx-source diff --git a/Tests/RunCMake/CXXModules/NotCompiledSourceModules.cmake b/Tests/RunCMake/CXXModules/NotCompiledSourceModules.cmake index 0bab635253f..11d789d48f6 100644 --- a/Tests/RunCMake/CXXModules/NotCompiledSourceModules.cmake +++ b/Tests/RunCMake/CXXModules/NotCompiledSourceModules.cmake @@ -1,5 +1,5 @@ enable_language(CXX) -set(CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE "") +set(CMAKE_CXX_SCANDEP_SOURCE "") add_library(not-cxx-source) target_sources(not-cxx-source diff --git a/Tests/RunCMake/CXXModules/examples/scan_properties/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/scan_properties/CMakeLists.txt index f2f1c38bf43..d53acfc5f04 100644 --- a/Tests/RunCMake/CXXModules/examples/scan_properties/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/scan_properties/CMakeLists.txt @@ -11,9 +11,9 @@ endif () # To detect that not-to-be scanned sources are not scanned, add a `-D` to the # scan flags so that the files can detect whether scanning happened and error # if not. -string(APPEND CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FLAG +string(APPEND CMAKE_CXX_MODULE_MAP_FLAG " -DCMAKE_SCANNED_THIS_SOURCE") -string(APPEND CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE +string(APPEND CMAKE_CXX_SCANDEP_SOURCE " -DCMAKE_SCANNED_THIS_SOURCE") set_property(SOURCE always_scan.cxx -- GitLab From 5eb7bd641a909925c6341819bc7900300776924f Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 21 Sep 2023 17:47:24 -0400 Subject: [PATCH 4/8] Tests/RunCMake/CXXModules: remove rules file requirement Only Clang needs to disable extensions in order to work; other implementations work as-is. --- .../ci/configure_linux_gcc_cxx_modules_ninja.cmake | 1 - ...nfigure_linux_gcc_cxx_modules_ninja_multi.cmake | 1 - ...configure_windows_msvc_cxx_modules_common.cmake | 1 - .gitlab/ci/cxx_modules_rules_clang.cmake | 2 -- .gitlab/ci/cxx_modules_rules_gcc.cmake | 1 - .gitlab/ci/cxx_modules_rules_msvc.cmake | 1 - .../CXXModules/examples/cxx-modules-rules.cmake | 14 ++------------ 7 files changed, 2 insertions(+), 19 deletions(-) delete mode 100644 .gitlab/ci/cxx_modules_rules_gcc.cmake delete mode 100644 .gitlab/ci/cxx_modules_rules_msvc.cmake diff --git a/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja.cmake b/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja.cmake index 8342db63744..f0ba9ebad44 100644 --- a/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja.cmake +++ b/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja.cmake @@ -1,4 +1,3 @@ set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,export_bmi,install_bmi,bmionly" CACHE STRING "") -set(CMake_TEST_MODULE_COMPILATION_RULES "${CMAKE_CURRENT_LIST_DIR}/cxx_modules_rules_gcc.cmake" CACHE STRING "") include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake") diff --git a/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja_multi.cmake b/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja_multi.cmake index 8342db63744..f0ba9ebad44 100644 --- a/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja_multi.cmake +++ b/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja_multi.cmake @@ -1,4 +1,3 @@ set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,export_bmi,install_bmi,bmionly" CACHE STRING "") -set(CMake_TEST_MODULE_COMPILATION_RULES "${CMAKE_CURRENT_LIST_DIR}/cxx_modules_rules_gcc.cmake" CACHE STRING "") include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake") diff --git a/.gitlab/ci/configure_windows_msvc_cxx_modules_common.cmake b/.gitlab/ci/configure_windows_msvc_cxx_modules_common.cmake index 2349bfd687d..e378d627295 100644 --- a/.gitlab/ci/configure_windows_msvc_cxx_modules_common.cmake +++ b/.gitlab/ci/configure_windows_msvc_cxx_modules_common.cmake @@ -1,2 +1 @@ set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,shared,export_bmi,install_bmi,bmionly" CACHE STRING "") -set(CMake_TEST_MODULE_COMPILATION_RULES "${CMAKE_CURRENT_LIST_DIR}/cxx_modules_rules_msvc.cmake" CACHE STRING "") diff --git a/.gitlab/ci/cxx_modules_rules_clang.cmake b/.gitlab/ci/cxx_modules_rules_clang.cmake index a8e1ff68ab0..12682447b9d 100644 --- a/.gitlab/ci/cxx_modules_rules_clang.cmake +++ b/.gitlab/ci/cxx_modules_rules_clang.cmake @@ -1,5 +1,3 @@ -set(CMake_TEST_CXXModules_UUID "a246741c-d067-4019-a8fb-3d16b0c9d1d3") - # Default to C++ extensions being off. Clang's modules support have trouble # with extensions right now. set(CMAKE_CXX_EXTENSIONS OFF) diff --git a/.gitlab/ci/cxx_modules_rules_gcc.cmake b/.gitlab/ci/cxx_modules_rules_gcc.cmake deleted file mode 100644 index 2b09b0e26db..00000000000 --- a/.gitlab/ci/cxx_modules_rules_gcc.cmake +++ /dev/null @@ -1 +0,0 @@ -set(CMake_TEST_CXXModules_UUID "a246741c-d067-4019-a8fb-3d16b0c9d1d3") diff --git a/.gitlab/ci/cxx_modules_rules_msvc.cmake b/.gitlab/ci/cxx_modules_rules_msvc.cmake deleted file mode 100644 index 2b09b0e26db..00000000000 --- a/.gitlab/ci/cxx_modules_rules_msvc.cmake +++ /dev/null @@ -1 +0,0 @@ -set(CMake_TEST_CXXModules_UUID "a246741c-d067-4019-a8fb-3d16b0c9d1d3") diff --git a/Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake b/Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake index da3c21516df..1016afd5511 100644 --- a/Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake +++ b/Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake @@ -1,15 +1,5 @@ -if (NOT EXISTS "${CMake_TEST_MODULE_COMPILATION_RULES}") - message(FATAL_ERROR - "The `CMake_TEST_MODULE_COMPILATION_RULES` file must be specified " - "for these tests to operate.") -endif () - -include("${CMake_TEST_MODULE_COMPILATION_RULES}") - -if (NOT CMake_TEST_CXXModules_UUID STREQUAL "a246741c-d067-4019-a8fb-3d16b0c9d1d3") - message(FATAL_ERROR - "The compilation rule file needs updated for changes in the test " - "suite. Please see the history for what needs to be updated.") +if (CMake_TEST_MODULE_COMPILATION_RULES) + include("${CMake_TEST_MODULE_COMPILATION_RULES}") endif () include(CTest) -- GitLab From 197a6bf1714267ad536f27fef5a24cbe6fd3fcff Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 27 Sep 2023 20:31:20 -0400 Subject: [PATCH 5/8] cxxmodules: rework control logic for scanning regular C++ sources Now that scanning support is no longer experimental, the logic for whether or not to scan C++ 20 sources is now important because all projects are now exposted to the logic. Make the scanning rules explicit in the documentation and rework the queries to localize all of the associated logic. A policy to handle the ultimate fallback logic will be implemented in a following commit. --- Help/manual/cmake-cxxmodules.7.rst | 17 +++ Source/cmGeneratorTarget.cxx | 122 +++++++++++++----- Source/cmGlobalVisualStudio7Generator.cxx | 8 -- Source/cmGlobalXCodeGenerator.cxx | 8 -- Source/cmMakefileTargetGenerator.cxx | 8 -- Source/cmVisualStudio10TargetGenerator.cxx | 9 -- Tests/RunCMake/CXXModules/NoCXX-stderr.txt | 13 +- Tests/RunCMake/CXXModules/NoCXX20-stderr.txt | 14 +- .../CXXModules/NoDyndepSupport-stderr.txt | 8 +- .../NoScanningSourceFileProperty-result.txt | 1 + .../NoScanningSourceFileProperty-stderr.txt | 9 ++ .../NoScanningSourceFileProperty.cmake | 13 ++ .../NoScanningTargetProperty-result.txt | 1 + .../NoScanningTargetProperty-stderr.txt | 9 ++ .../CXXModules/NoScanningTargetProperty.cmake | 10 ++ Tests/RunCMake/CXXModules/RunCMakeTest.cmake | 3 + 16 files changed, 166 insertions(+), 87 deletions(-) create mode 100644 Tests/RunCMake/CXXModules/NoScanningSourceFileProperty-result.txt create mode 100644 Tests/RunCMake/CXXModules/NoScanningSourceFileProperty-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/NoScanningSourceFileProperty.cmake create mode 100644 Tests/RunCMake/CXXModules/NoScanningTargetProperty-result.txt create mode 100644 Tests/RunCMake/CXXModules/NoScanningTargetProperty-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/NoScanningTargetProperty.cmake diff --git a/Help/manual/cmake-cxxmodules.7.rst b/Help/manual/cmake-cxxmodules.7.rst index 91acae1986b..a082f58c872 100644 --- a/Help/manual/cmake-cxxmodules.7.rst +++ b/Help/manual/cmake-cxxmodules.7.rst @@ -12,6 +12,23 @@ to scan source files for module dependencies during the build, collates scanning results to infer ordering constraints, and tells the build tool how to dynamically update the build graph. +Scanning Control +================ + +Whether or not sources get scanned for C++ module usage is dependent on the +following queries. The first query that provides a yes/no answer is used. + +- If the source file belongs to a file set of type ``CXX_MODULES``, it will + be scanned. +- If the target does not use at least C++ 20, it will not be scanned. +- If the source file is not the language ``CXX``, it will not be scanned. +- If the :prop_sf:`CXX_SCAN_FOR_MODULES` source file property is set, its + value will be used. +- If the :prop_tgt:`CXX_SCAN_FOR_MODULES` target property is set, its value + will be used. Set the :variable:`CMAKE_CXX_SCAN_FOR_MODULES` variable + to initialize this property on all targets as they are created. +- Otherwise the source will be scanned. + Compiler Support ================ diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index bbb47e40153..93946aa2e7b 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -9115,39 +9115,83 @@ cmGeneratorTarget::Cxx20SupportLevel cmGeneratorTarget::HaveCxxModuleSupport( void cmGeneratorTarget::CheckCxxModuleStatus(std::string const& config) const { + bool haveScannableSources = false; + // Check for `CXX_MODULE*` file sets and a lack of support. if (this->HaveCxx20ModuleSources()) { - switch (this->HaveCxxModuleSupport(config)) { - case cmGeneratorTarget::Cxx20SupportLevel::MissingCxx: - this->Makefile->IssueMessage( - MessageType::FATAL_ERROR, - cmStrCat("The target named \"", this->GetName(), - "\" has C++ sources that export modules but the \"CXX\" " - "language has not been enabled")); - break; - case cmGeneratorTarget::Cxx20SupportLevel::NoCxx20: { - cmStandardLevelResolver standardResolver(this->Makefile); - auto effStandard = - standardResolver.GetEffectiveStandard(this, "CXX", config); - if (effStandard.empty()) { - effStandard = "; no C++ standard found"; - } else { - effStandard = cmStrCat("; found \"cxx_std_", effStandard, '"'); - } - this->Makefile->IssueMessage( - MessageType::FATAL_ERROR, - cmStrCat( - "The target named \"", this->GetName(), - "\" has C++ sources that export modules but does not include " - "\"cxx_std_20\" (or newer) among its `target_compile_features`", - effStandard)); - } break; - case cmGeneratorTarget::Cxx20SupportLevel::MissingRule: - case cmGeneratorTarget::Cxx20SupportLevel::Supported: - // All is well. - break; + haveScannableSources = true; + } + + if (!haveScannableSources) { + // Check to see if there are regular sources that have requested scanning. + auto sources = cmGeneratorTarget::GetSourceFiles(config); + for (auto const& source : sources) { + auto const* sf = source.Value; + auto const& lang = sf->GetLanguage(); + if (lang != "CXX"_s) { + continue; + } + // Ignore sources which do not need dyndep. + if (this->NeedDyndepForSource(lang, config, sf)) { + haveScannableSources = true; + } } } + + // If there isn't anything scannable, ignore it. + if (!haveScannableSources) { + return; + } + + // If the generator doesn't support modules at all, error that we have + // sources that require the support. + if (!this->GetGlobalGenerator()->CheckCxxModuleSupport()) { + this->Makefile->IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat( + "The target named \"", this->GetName(), + "\" contains C++ " + "sources that use modules which is not supported by the generator")); + return; + } + + switch (this->HaveCxxModuleSupport(config)) { + case cmGeneratorTarget::Cxx20SupportLevel::MissingCxx: + this->Makefile->IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat("The target named \"", this->GetName(), + "\" has C++ sources that use modules but the \"CXX\" " + "language has not been enabled")); + break; + case cmGeneratorTarget::Cxx20SupportLevel::NoCxx20: { + cmStandardLevelResolver standardResolver(this->Makefile); + auto effStandard = + standardResolver.GetEffectiveStandard(this, "CXX", config); + if (effStandard.empty()) { + effStandard = "; no C++ standard found"; + } else { + effStandard = cmStrCat("; found \"cxx_std_", effStandard, '"'); + } + this->Makefile->IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat( + "The target named \"", this->GetName(), + "\" has C++ sources that use modules but does not include " + "\"cxx_std_20\" (or newer) among its `target_compile_features`", + effStandard)); + } break; + case cmGeneratorTarget::Cxx20SupportLevel::MissingRule: { + this->Makefile->IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat("The target named \"", this->GetName(), + "\" has C++ sources that use modules but the compiler does " + "not provide a way to discover the import graph " + "dependencies")); + } break; + case cmGeneratorTarget::Cxx20SupportLevel::Supported: + // All is well. + break; + } } bool cmGeneratorTarget::NeedCxxModuleSupport(std::string const& lang, @@ -9185,14 +9229,30 @@ bool cmGeneratorTarget::NeedDyndepForSource(std::string const& lang, std::string const& config, cmSourceFile const* sf) const { - bool const needDyndep = this->NeedDyndep(lang, config); - if (!needDyndep) { + // Fortran always needs to be scanned. + if (lang == "Fortran"_s) { + return true; + } + // Only C++ code needs scanned otherwise. + if (lang != "CXX"_s) { return false; } + + // Any file in `CXX_MODULES` file sets need scanned (it being `CXX` is + // enforced elsewhere). auto const* fs = this->GetFileSetForSource(config, sf); if (fs && fs->GetType() == "CXX_MODULES"_s) { return true; } + + switch (this->HaveCxxModuleSupport(config)) { + case Cxx20SupportLevel::MissingCxx: + case Cxx20SupportLevel::NoCxx20: + return false; + case Cxx20SupportLevel::MissingRule: + case Cxx20SupportLevel::Supported: + break; + } auto const sfProp = sf->GetProperty("CXX_SCAN_FOR_MODULES"); if (sfProp.IsSet()) { return sfProp.IsOn(); diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 6953ec6823a..1abdd0b3818 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -435,14 +435,6 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution( target->CheckCxxModuleStatus(c); } - if (target->HaveCxx20ModuleSources() && !this->SupportsCxxModuleDyndep()) { - root->GetMakefile()->IssueMessage( - MessageType::FATAL_ERROR, - cmStrCat("The target named \"", target->GetName(), - "\" contains C++ sources that export modules which is not " - "supported by the generator")); - } - // handle external vc project files cmValue expath = target->GetProperty("EXTERNAL_MSPROJECT"); if (expath) { diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 90b883901f5..5076e6c0400 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1384,14 +1384,6 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget( gtgt->CheckCxxModuleStatus(configName); } - if (gtgt->HaveCxx20ModuleSources()) { - gtgt->Makefile->IssueMessage( - MessageType::FATAL_ERROR, - cmStrCat("The target named \"", gtgt->GetName(), - "\" contains C++ sources that export modules which is not " - "supported by the generator")); - } - auto& gtgt_visited = this->CommandsVisited[gtgt]; auto const& deps = this->GetTargetDirectDepends(gtgt); for (auto const& d : deps) { diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index caa5e672475..0c2a719736d 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -204,14 +204,6 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules() { this->GeneratorTarget->CheckCxxModuleStatus(this->GetConfigName()); - if (this->GeneratorTarget->HaveCxx20ModuleSources()) { - this->Makefile->IssueMessage( - MessageType::FATAL_ERROR, - cmStrCat("The target named \"", this->GeneratorTarget->GetName(), - "\" contains C++ sources that export modules which is not " - "supported by the generator")); - } - // -- Write the custom commands for this target // Evaluates generator expressions and expands prop_value diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 2a54a556f47..ce94fe130d1 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -362,15 +362,6 @@ void cmVisualStudio10TargetGenerator::Generate() this->GeneratorTarget->CheckCxxModuleStatus(config); } - if (this->GeneratorTarget->HaveCxx20ModuleSources() && - !this->GlobalGenerator->SupportsCxxModuleDyndep()) { - this->Makefile->IssueMessage( - MessageType::FATAL_ERROR, - cmStrCat("The target named \"", this->GeneratorTarget->GetName(), - "\" contains C++ sources that export modules which is not " - "supported by the generator")); - } - this->ProjectType = computeProjectType(this->GeneratorTarget); this->Managed = this->ProjectType == VsProjectType::csproj; const std::string ProjectFileExtension = diff --git a/Tests/RunCMake/CXXModules/NoCXX-stderr.txt b/Tests/RunCMake/CXXModules/NoCXX-stderr.txt index 5b609a9a577..da65c26cf63 100644 --- a/Tests/RunCMake/CXXModules/NoCXX-stderr.txt +++ b/Tests/RunCMake/CXXModules/NoCXX-stderr.txt @@ -1,13 +1,8 @@ -CMake Error in CMakeLists.txt: - The target named "nocxx" has C\+\+ sources that export modules but the "CXX" +(CMake Error in CMakeLists.txt: +( The target named "nocxx" has C\+\+ sources that use modules but the "CXX" language has not been enabled - -( -CMake Error in CMakeLists.txt: -( The target named "nocxx" has C\+\+ sources that export modules but the "CXX" - language has not been enabled -| The target named "nocxx" contains C\+\+ sources that export modules which is - not supported by the generator +| The target named "nocxx" contains C\+\+ sources that use modules which is not + supported by the generator | Target "nocxx" has source file .*/Tests/RunCMake/CXXModules/sources/module.cxx diff --git a/Tests/RunCMake/CXXModules/NoCXX20-stderr.txt b/Tests/RunCMake/CXXModules/NoCXX20-stderr.txt index 4a1641b85c6..5a9b6e7156f 100644 --- a/Tests/RunCMake/CXXModules/NoCXX20-stderr.txt +++ b/Tests/RunCMake/CXXModules/NoCXX20-stderr.txt @@ -1,15 +1,9 @@ -CMake Error in CMakeLists.txt: - The target named "nocxx20" has C\+\+ sources that export modules but does not +(CMake Error in CMakeLists.txt: +( The target named "nocxx20" has C\+\+ sources that use modules but does not include "cxx_std_20" \(or newer\) among its `target_compile_features`; found "cxx_std_17" - -( -CMake Error in CMakeLists.txt: -( The target named "nocxx20" has C\+\+ sources that export modules but does not - include "cxx_std_20" \(or newer\) among its `target_compile_features`; found - "cxx_std_17" -| The target named "nocxx20" contains C\+\+ sources that export modules which - is not supported by the generator +| The target named "nocxx20" contains C\+\+ sources that use modules which is + not supported by the generator ) )* CMake Generate step failed. Build files cannot be regenerated correctly. diff --git a/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt b/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt index 6640c99c3d0..6a9c995da59 100644 --- a/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt +++ b/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt @@ -6,13 +6,13 @@ due to lack of required features. Ninja 1.11 or higher is required. |CMake Error in CMakeLists.txt: - The target named "nodyndep" contains C\+\+ sources that export modules which - is not supported by the generator + The target named "nodyndep" contains C\+\+ sources that use modules which is + not supported by the generator ( CMake Error in CMakeLists.txt: - The target named "nodyndep" contains C\+\+ sources that export modules which - is not supported by the generator + The target named "nodyndep" contains C\+\+ sources that use modules which is + not supported by the generator )*) CMake Generate step failed. Build files cannot be regenerated correctly. diff --git a/Tests/RunCMake/CXXModules/NoScanningSourceFileProperty-result.txt b/Tests/RunCMake/CXXModules/NoScanningSourceFileProperty-result.txt new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/Tests/RunCMake/CXXModules/NoScanningSourceFileProperty-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CXXModules/NoScanningSourceFileProperty-stderr.txt b/Tests/RunCMake/CXXModules/NoScanningSourceFileProperty-stderr.txt new file mode 100644 index 00000000000..464627cf997 --- /dev/null +++ b/Tests/RunCMake/CXXModules/NoScanningSourceFileProperty-stderr.txt @@ -0,0 +1,9 @@ +(CMake Error in CMakeLists.txt: +( The target named "noscanning-sf-property" has C\+\+ sources that use modules + but the compiler does not provide a way to discover the import graph + dependencies +| The target named "noscanning-sf-property" contains C\+\+ sources that use modules which + is not supported by the generator +) +)* +CMake Generate step failed. Build files cannot be regenerated correctly. diff --git a/Tests/RunCMake/CXXModules/NoScanningSourceFileProperty.cmake b/Tests/RunCMake/CXXModules/NoScanningSourceFileProperty.cmake new file mode 100644 index 00000000000..f356a11d402 --- /dev/null +++ b/Tests/RunCMake/CXXModules/NoScanningSourceFileProperty.cmake @@ -0,0 +1,13 @@ +enable_language(CXX) +unset(CMAKE_CXX_SCANDEP_SOURCE) + +add_executable(noscanning-sf-property + sources/module-use.cxx) +set_target_properties(noscanning-sf-property + PROPERTIES + CXX_STANDARD 20 + CXX_STANDARD_REQUIRED ON + CXX_SCAN_FOR_MODULES 0) +set_source_files_properties(sources/module-use.cxx + PROPERTIES + CXX_SCAN_FOR_MODULES 1) diff --git a/Tests/RunCMake/CXXModules/NoScanningTargetProperty-result.txt b/Tests/RunCMake/CXXModules/NoScanningTargetProperty-result.txt new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/Tests/RunCMake/CXXModules/NoScanningTargetProperty-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CXXModules/NoScanningTargetProperty-stderr.txt b/Tests/RunCMake/CXXModules/NoScanningTargetProperty-stderr.txt new file mode 100644 index 00000000000..72c7a0acd15 --- /dev/null +++ b/Tests/RunCMake/CXXModules/NoScanningTargetProperty-stderr.txt @@ -0,0 +1,9 @@ +(CMake Error in CMakeLists.txt: +( The target named "noscanning-target-property" has C\+\+ sources that use + modules but the compiler does not provide a way to discover the import + graph dependencies +| The target named "noscanning-target-property" contains C\+\+ sources that use modules which + is not supported by the generator +) +)* +CMake Generate step failed. Build files cannot be regenerated correctly. diff --git a/Tests/RunCMake/CXXModules/NoScanningTargetProperty.cmake b/Tests/RunCMake/CXXModules/NoScanningTargetProperty.cmake new file mode 100644 index 00000000000..97a3d445436 --- /dev/null +++ b/Tests/RunCMake/CXXModules/NoScanningTargetProperty.cmake @@ -0,0 +1,10 @@ +enable_language(CXX) +unset(CMAKE_CXX_SCANDEP_SOURCE) + +add_executable(noscanning-target-property + sources/module-use.cxx) +set_target_properties(noscanning-target-property + PROPERTIES + CXX_STANDARD 20 + CXX_STANDARD_REQUIRED ON + CXX_SCAN_FOR_MODULES 1) diff --git a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake index 2f323129432..a697659ec28 100644 --- a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake +++ b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake @@ -14,6 +14,9 @@ if ("cxx_std_20" IN_LIST CMAKE_CXX_COMPILE_FEATURES) if (NOT forced_cxx_standard) run_cmake(NoCXX20) endif () + + run_cmake(NoScanningSourceFileProperty) + run_cmake(NoScanningTargetProperty) endif () if (RunCMake_GENERATOR MATCHES "Ninja") -- GitLab From 068fde1c348459ca41cdd6c21d782ba1491746c4 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 28 Sep 2023 16:09:17 -0400 Subject: [PATCH 6/8] cmGeneratorTarget: use `this->` for method calls --- Source/cmGeneratorTarget.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 93946aa2e7b..22092b19dbf 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -9046,7 +9046,7 @@ std::string cmGeneratorTarget::GetImportedXcFrameworkPath( bool cmGeneratorTarget::HaveFortranSources(std::string const& config) const { - auto sources = cmGeneratorTarget::GetSourceFiles(config); + auto sources = this->GetSourceFiles(config); return std::any_of(sources.begin(), sources.end(), [](BT const& sf) -> bool { return sf.Value->GetLanguage() == "Fortran"_s; @@ -9124,7 +9124,7 @@ void cmGeneratorTarget::CheckCxxModuleStatus(std::string const& config) const if (!haveScannableSources) { // Check to see if there are regular sources that have requested scanning. - auto sources = cmGeneratorTarget::GetSourceFiles(config); + auto sources = this->GetSourceFiles(config); for (auto const& source : sources) { auto const* sf = source.Value; auto const& lang = sf->GetLanguage(); -- GitLab From 3cddd116495a85ce86e1149c05ce9a2a701e0c8b Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 28 Sep 2023 16:08:06 -0400 Subject: [PATCH 7/8] Ninja: message about not compiled sources explicitly With CMP0155, filesets with only non-compiled sources do not go through the collation path that detects it. Detect it explicitly like the Visual Studio generator does. --- Source/cmNinjaTargetGenerator.cxx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 5d4397b4824..0bda94573cd 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -1143,6 +1143,30 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements( } } + // Detect sources in `CXX_MODULES` which are not compiled. + { + std::vector sources; + this->GeneratorTarget->GetSourceFiles(sources, config); + for (cmSourceFile const* sf : sources) { + cmFileSet const* fs = + this->GeneratorTarget->GetFileSetForSource(config, sf); + if (!fs) { + continue; + } + if (fs->GetType() != "CXX_MODULES"_s) { + continue; + } + if (sf->GetLanguage().empty()) { + this->GeneratorTarget->Makefile->IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat("Target \"", this->GeneratorTarget->GetName(), + "\" has source file\n ", sf->GetFullPath(), + "\nin a \"FILE_SET TYPE CXX_MODULES\" but it is not " + "scheduled for compilation.")); + } + } + } + for (auto const& langScanningFiles : this->Configs[config].ScanningInfo) { std::string const& language = langScanningFiles.first; std::vector const& scanningFiles = langScanningFiles.second; -- GitLab From 437280b1273cf80287639ef4d6a0a9266e23c2b1 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 27 Sep 2023 21:57:54 -0400 Subject: [PATCH 8/8] cxxmodules: scan C++ sources for imports by default Existing projects are not using C++ modules in their sources, so introduce policy CMP0155 to enable scanning by default. --- Help/manual/cmake-cxxmodules.7.rst | 2 +- Help/manual/cmake-policies.7.rst | 1 + Help/policy/CMP0155.rst | 26 +++++++++++++++++++ Source/cmCoreTryCompile.cxx | 7 +++++ Source/cmGeneratorTarget.cxx | 17 +++++++++++- Source/cmPolicies.h | 7 ++++- .../CXXModules/CMP0155-NEW-result.txt | 1 + .../CXXModules/CMP0155-NEW-stderr.txt | 8 ++++++ Tests/RunCMake/CXXModules/CMP0155-NEW.cmake | 11 ++++++++ Tests/RunCMake/CXXModules/CMP0155-OLD.cmake | 11 ++++++++ Tests/RunCMake/CXXModules/RunCMakeTest.cmake | 2 ++ .../examples/circular/CMakeLists.txt | 2 +- .../examples/deep-chain/CMakeLists.txt | 2 +- .../examples/duplicate/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../test/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../test/CMakeLists.txt | 2 +- .../export-compile-commands/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../test/CMakeLists.txt | 2 +- .../export-interface-build/CMakeLists.txt | 2 +- .../test/CMakeLists.txt | 2 +- .../export-interface-install/CMakeLists.txt | 2 +- .../test/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../test/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../test/CMakeLists.txt | 2 +- .../export-usage-build/CMakeLists.txt | 2 +- .../export-usage-build/test/CMakeLists.txt | 2 +- .../export-usage-install/CMakeLists.txt | 2 +- .../export-usage-install/test/CMakeLists.txt | 2 +- .../examples/generated/CMakeLists.txt | 2 +- .../examples/import-modules/CMakeLists.txt | 2 +- .../install-bmi-and-interfaces/CMakeLists.txt | 2 +- .../examples/install-bmi/CMakeLists.txt | 2 +- .../internal-partitions/CMakeLists.txt | 2 +- .../examples/library/CMakeLists.txt | 2 +- .../examples/object-library/CMakeLists.txt | 2 +- .../examples/partitions/CMakeLists.txt | 2 +- .../public-req-private/CMakeLists.txt | 2 +- .../req-private-other-target/CMakeLists.txt | 2 +- .../examples/same-src-name/CMakeLists.txt | 2 +- .../examples/scan_properties/CMakeLists.txt | 2 +- .../CXXModules/examples/simple/CMakeLists.txt | 2 +- .../examples/try-compile/CMakeLists.txt | 2 +- .../examples/try-run/CMakeLists.txt | 2 +- .../TargetPolicies/PolicyList-stderr.txt | 1 + 50 files changed, 129 insertions(+), 41 deletions(-) create mode 100644 Help/policy/CMP0155.rst create mode 100644 Tests/RunCMake/CXXModules/CMP0155-NEW-result.txt create mode 100644 Tests/RunCMake/CXXModules/CMP0155-NEW-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/CMP0155-NEW.cmake create mode 100644 Tests/RunCMake/CXXModules/CMP0155-OLD.cmake diff --git a/Help/manual/cmake-cxxmodules.7.rst b/Help/manual/cmake-cxxmodules.7.rst index a082f58c872..57764217671 100644 --- a/Help/manual/cmake-cxxmodules.7.rst +++ b/Help/manual/cmake-cxxmodules.7.rst @@ -27,7 +27,7 @@ following queries. The first query that provides a yes/no answer is used. - If the :prop_tgt:`CXX_SCAN_FOR_MODULES` target property is set, its value will be used. Set the :variable:`CMAKE_CXX_SCAN_FOR_MODULES` variable to initialize this property on all targets as they are created. -- Otherwise the source will be scanned. +- Otherwise, the source file will be scanned. See policy :policy:`CMP0155`. Compiler Support ================ diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index dff4f340a6e..047dfd13b05 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -57,6 +57,7 @@ Policies Introduced by CMake 3.28 .. toctree:: :maxdepth: 1 + CMP0155: C++ sources in targets with at least C++20 are scanned for imports. CMP0154: Generated files are private by default in targets using file sets. CMP0153: The exec_program command should not be called. CMP0152: file(REAL_PATH) resolves symlinks before collapsing ../ components. diff --git a/Help/policy/CMP0155.rst b/Help/policy/CMP0155.rst new file mode 100644 index 00000000000..2dafadf3dd6 --- /dev/null +++ b/Help/policy/CMP0155.rst @@ -0,0 +1,26 @@ +CMP0155 +------- + +.. versionadded:: 3.28 + +C++ sources in targets with at least C++20 are scanned for imports. + +CMake 3.27 and below assume that C++ sources do not ``import`` modules. +CMake 3.28 and above prefer to assume that C++ sources in targets using C++20 +or higher might ``import`` modules, and must be scanned before compiling, +unless explicitly disabled. This policy provides compatibility for projects +that use C++20 or higher, without modules, that have not been updated to turn +off scanning, e.g., via the :variable:`CMAKE_CXX_SCAN_FOR_MODULES` variable. +See the :manual:`cmake-cxxmodules(7)` manual for more details on C++ module +support. + +The ``OLD`` behavior for this policy is to assume that C++ 20 and newer +sources do not import modules. The ``NEW`` behavior for this policy is to +assume that C++ 20 and newer files may import modules, and need to be scanned. + +This policy was introduced in CMake version 3.28. Use the +:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly. +Unlike many policies, CMake version |release| does *not* warn +when this policy is not set and simply uses ``OLD`` behavior. + +.. include:: DEPRECATED.txt diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 6ca0e14928f..67462f50c47 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -871,6 +871,13 @@ cm::optional cmCoreTryCompile::TryCompileCode( ? "NEW" : "OLD"); + /* Set the appropriate policy information for C++ module support */ + fprintf(fout, "cmake_policy(SET CMP0155 %s)\n", + this->Makefile->GetPolicyStatus(cmPolicies::CMP0155) == + cmPolicies::NEW + ? "NEW" + : "OLD"); + // Workaround for -Wl,-headerpad_max_install_names issue until we can avoid // adding that flag in the platform and compiler language files fprintf(fout, diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 22092b19dbf..96fcf7e80d6 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -9261,7 +9261,22 @@ bool cmGeneratorTarget::NeedDyndepForSource(std::string const& lang, if (tgtProp.IsSet()) { return tgtProp.IsOn(); } - return true; + + bool policyAnswer = false; + switch (this->GetPolicyStatusCMP0155()) { + case cmPolicies::WARN: + case cmPolicies::OLD: + // The OLD behavior is to not scan the source. + policyAnswer = false; + break; + case cmPolicies::REQUIRED_ALWAYS: + case cmPolicies::REQUIRED_IF_USED: + case cmPolicies::NEW: + // The NEW behavior is to scan the source. + policyAnswer = true; + break; + } + return policyAnswer; } void cmGeneratorTarget::BuildFileSetInfoCache(std::string const& config) const diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index e8940739fe4..1ea2ce263f7 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -469,6 +469,10 @@ class cmMakefile; SELECT( \ POLICY, CMP0154, \ "Generated files are private by default in targets using file sets.", 3, \ + 28, 0, cmPolicies::WARN) \ + SELECT( \ + POLICY, CMP0155, \ + "C++ sources in targets with at least C++20 are scanned for imports", 3, \ 28, 0, cmPolicies::WARN) #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1) @@ -508,7 +512,8 @@ class cmMakefile; F(CMP0119) \ F(CMP0131) \ F(CMP0142) \ - F(CMP0154) + F(CMP0154) \ + F(CMP0155) #define CM_FOR_EACH_CUSTOM_COMMAND_POLICY(F) \ F(CMP0116) \ diff --git a/Tests/RunCMake/CXXModules/CMP0155-NEW-result.txt b/Tests/RunCMake/CXXModules/CMP0155-NEW-result.txt new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/Tests/RunCMake/CXXModules/CMP0155-NEW-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CXXModules/CMP0155-NEW-stderr.txt b/Tests/RunCMake/CXXModules/CMP0155-NEW-stderr.txt new file mode 100644 index 00000000000..39575d4a953 --- /dev/null +++ b/Tests/RunCMake/CXXModules/CMP0155-NEW-stderr.txt @@ -0,0 +1,8 @@ +(CMake Error in CMakeLists.txt: +( The target named "cmp0155-new" has C\+\+ sources that use modules but the + compiler does not provide a way to discover the import graph dependencies +| The target named "cmp0155-new" contains C\+\+ sources that use modules which + is not supported by the generator +) +)* +CMake Generate step failed. Build files cannot be regenerated correctly. diff --git a/Tests/RunCMake/CXXModules/CMP0155-NEW.cmake b/Tests/RunCMake/CXXModules/CMP0155-NEW.cmake new file mode 100644 index 00000000000..bea858b55ef --- /dev/null +++ b/Tests/RunCMake/CXXModules/CMP0155-NEW.cmake @@ -0,0 +1,11 @@ +enable_language(CXX) +unset(CMAKE_CXX_SCANDEP_SOURCE) + +cmake_policy(SET CMP0155 NEW) + +add_executable(cmp0155-new + sources/module-use.cxx) +set_target_properties(cmp0155-new + PROPERTIES + CXX_STANDARD 20 + CXX_STANDARD_REQUIRED ON) diff --git a/Tests/RunCMake/CXXModules/CMP0155-OLD.cmake b/Tests/RunCMake/CXXModules/CMP0155-OLD.cmake new file mode 100644 index 00000000000..201598e7a00 --- /dev/null +++ b/Tests/RunCMake/CXXModules/CMP0155-OLD.cmake @@ -0,0 +1,11 @@ +enable_language(CXX) +unset(CMAKE_CXX_SCANDEP_SOURCE) + +cmake_policy(SET CMP0155 OLD) + +add_executable(cmp0155-old + sources/module-use.cxx) +set_target_properties(cmp0155-old + PROPERTIES + CXX_STANDARD 20 + CXX_STANDARD_REQUIRED ON) diff --git a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake index a697659ec28..8b226875461 100644 --- a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake +++ b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake @@ -17,6 +17,8 @@ if ("cxx_std_20" IN_LIST CMAKE_CXX_COMPILE_FEATURES) run_cmake(NoScanningSourceFileProperty) run_cmake(NoScanningTargetProperty) + run_cmake(CMP0155-OLD) + run_cmake(CMP0155-NEW) endif () if (RunCMake_GENERATOR MATCHES "Ninja") diff --git a/Tests/RunCMake/CXXModules/examples/circular/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/circular/CMakeLists.txt index 4d1997cd43a..c1b000e5e53 100644 --- a/Tests/RunCMake/CXXModules/examples/circular/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/circular/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_circular CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") diff --git a/Tests/RunCMake/CXXModules/examples/deep-chain/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/deep-chain/CMakeLists.txt index 78a1d0b75c6..153a2df15e7 100644 --- a/Tests/RunCMake/CXXModules/examples/deep-chain/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/deep-chain/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_deep_chain CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") diff --git a/Tests/RunCMake/CXXModules/examples/duplicate/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/duplicate/CMakeLists.txt index 27be7a8a02e..51ad167ab1f 100644 --- a/Tests/RunCMake/CXXModules/examples/duplicate/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/duplicate/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_duplicate CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") diff --git a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/CMakeLists.txt index 71e7b62e2bf..cbe8fb749a1 100644 --- a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_export_bmi_and_interfaces CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") 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 e23cefecd5b..0666ff189d6 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,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_library NONE) find_package(export_bmi_and_interfaces REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/CMakeLists.txt index e6755074360..c8679d651ce 100644 --- a/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_export_bmi_and_interfaces CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") 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 eb6c19cd6fe..36b0e8bd062 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,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_library NONE) find_package(export_bmi_and_interfaces REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/export-compile-commands/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-compile-commands/CMakeLists.txt index 2eb4d5f16b7..b9c7bb3c672 100644 --- a/Tests/RunCMake/CXXModules/examples/export-compile-commands/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-compile-commands/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_export_compile_commands CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-build/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-include-directories-build/CMakeLists.txt index bc2ae7f2e94..560994e0946 100644 --- a/Tests/RunCMake/CXXModules/examples/export-include-directories-build/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-build/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_export_include_directories CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-install/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/CMakeLists.txt index 444882d10c5..3d4e687a319 100644 --- a/Tests/RunCMake/CXXModules/examples/export-include-directories-install/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_export_include_directories CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-install/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/test/CMakeLists.txt index 9cdb7ff7a29..12a533bcca3 100644 --- a/Tests/RunCMake/CXXModules/examples/export-include-directories-install/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_library NONE) set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "ac01f462-0f5f-432a-86aa-acef252918a6") diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-build/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-build/CMakeLists.txt index 136e885f129..df471af8efc 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-build/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-build/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_export_interfaces CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") 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 2e6d6030351..95fb6e82cee 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_library NONE) find_package(export_interfaces REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-install/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-install/CMakeLists.txt index df8798086f2..019ae4ad45a 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-install/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-install/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_export_interfaces CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") 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 a2c51b0c934..725090e737b 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_library NONE) find_package(export_interfaces REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/CMakeLists.txt index a93e3a4fb25..decadf79f51 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_export_interfaces_no_properties CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt index 4b4fe043ded..cd8d1dfa8a2 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_library NONE) find_package(export_interfaces_no_properties REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/CMakeLists.txt index 99e67e7f06a..be32ecdefbf 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_export_interfaces CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") diff --git a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt index 4b4fe043ded..cd8d1dfa8a2 100644 --- a/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_library NONE) find_package(export_interfaces_no_properties REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/export-usage-build/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-usage-build/CMakeLists.txt index 86a608bb6a5..a58e2872133 100644 --- a/Tests/RunCMake/CXXModules/examples/export-usage-build/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-usage-build/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_export_usage CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") diff --git a/Tests/RunCMake/CXXModules/examples/export-usage-build/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-usage-build/test/CMakeLists.txt index 4a6728b50d2..c84153d288d 100644 --- a/Tests/RunCMake/CXXModules/examples/export-usage-build/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-usage-build/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_library NONE) find_package(export_usage REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/export-usage-install/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-usage-install/CMakeLists.txt index 11f53b07933..3d7d67b1738 100644 --- a/Tests/RunCMake/CXXModules/examples/export-usage-install/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-usage-install/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_export_usage CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") diff --git a/Tests/RunCMake/CXXModules/examples/export-usage-install/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-usage-install/test/CMakeLists.txt index 28ff3bd5ea9..ceb428ba92b 100644 --- a/Tests/RunCMake/CXXModules/examples/export-usage-install/test/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-usage-install/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_library NONE) find_package(export_usage REQUIRED) diff --git a/Tests/RunCMake/CXXModules/examples/generated/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/generated/CMakeLists.txt index 9a8da3dca1b..efa825aff86 100644 --- a/Tests/RunCMake/CXXModules/examples/generated/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/generated/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_generated CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") diff --git a/Tests/RunCMake/CXXModules/examples/import-modules/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/import-modules/CMakeLists.txt index 946792cba05..8e1db5d95d9 100644 --- a/Tests/RunCMake/CXXModules/examples/import-modules/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/import-modules/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_import_interfaces CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") diff --git a/Tests/RunCMake/CXXModules/examples/install-bmi-and-interfaces/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/install-bmi-and-interfaces/CMakeLists.txt index efaca0e1106..0beb6723b1c 100644 --- a/Tests/RunCMake/CXXModules/examples/install-bmi-and-interfaces/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/install-bmi-and-interfaces/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_install_bmi_and_interfaces CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") diff --git a/Tests/RunCMake/CXXModules/examples/install-bmi/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/install-bmi/CMakeLists.txt index 4e039f9f246..4047612bbb8 100644 --- a/Tests/RunCMake/CXXModules/examples/install-bmi/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/install-bmi/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_install_bmi CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") diff --git a/Tests/RunCMake/CXXModules/examples/internal-partitions/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/internal-partitions/CMakeLists.txt index f5e9d942d6b..bf99f7c1217 100644 --- a/Tests/RunCMake/CXXModules/examples/internal-partitions/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/internal-partitions/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_internal_partitions CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") diff --git a/Tests/RunCMake/CXXModules/examples/library/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/library/CMakeLists.txt index 27fd94f3fa8..97d2325b0ef 100644 --- a/Tests/RunCMake/CXXModules/examples/library/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/library/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_library CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") diff --git a/Tests/RunCMake/CXXModules/examples/object-library/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/object-library/CMakeLists.txt index 238e30a1930..c858b3ea5e3 100644 --- a/Tests/RunCMake/CXXModules/examples/object-library/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/object-library/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_objlib CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") diff --git a/Tests/RunCMake/CXXModules/examples/partitions/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/partitions/CMakeLists.txt index 3a7b0d4a3b8..07d32ae9ced 100644 --- a/Tests/RunCMake/CXXModules/examples/partitions/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/partitions/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_partitions CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") diff --git a/Tests/RunCMake/CXXModules/examples/public-req-private/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/public-req-private/CMakeLists.txt index 600fec4b5b1..f59f237bc1b 100644 --- a/Tests/RunCMake/CXXModules/examples/public-req-private/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/public-req-private/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_public_req_private CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") diff --git a/Tests/RunCMake/CXXModules/examples/req-private-other-target/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/req-private-other-target/CMakeLists.txt index 910c51557a4..68da6177346 100644 --- a/Tests/RunCMake/CXXModules/examples/req-private-other-target/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/req-private-other-target/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.26) +cmake_minimum_required(VERSION 3.26...3.28) project(req_private_other_target CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") diff --git a/Tests/RunCMake/CXXModules/examples/same-src-name/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/same-src-name/CMakeLists.txt index 997bbb196e0..8a47b0c317b 100644 --- a/Tests/RunCMake/CXXModules/examples/same-src-name/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/same-src-name/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.27) +cmake_minimum_required(VERSION 3.27...3.28) project(cxx_modules_same_src_name CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") diff --git a/Tests/RunCMake/CXXModules/examples/scan_properties/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/scan_properties/CMakeLists.txt index d53acfc5f04..f5e5da64276 100644 --- a/Tests/RunCMake/CXXModules/examples/scan_properties/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/scan_properties/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(scan_properties CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") diff --git a/Tests/RunCMake/CXXModules/examples/simple/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/simple/CMakeLists.txt index 442e4256bcf..43f425acf73 100644 --- a/Tests/RunCMake/CXXModules/examples/simple/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/simple/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_simple CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") diff --git a/Tests/RunCMake/CXXModules/examples/try-compile/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/try-compile/CMakeLists.txt index dee61f15867..66c32bafdc8 100644 --- a/Tests/RunCMake/CXXModules/examples/try-compile/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/try-compile/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_try_compile CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") diff --git a/Tests/RunCMake/CXXModules/examples/try-run/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/try-run/CMakeLists.txt index fb03571af08..9480d740e45 100644 --- a/Tests/RunCMake/CXXModules/examples/try-run/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/try-run/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.24) +cmake_minimum_required(VERSION 3.24...3.28) project(cxx_modules_try_run CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt index 7e91b76361f..c2187ae1d67 100644 --- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt +++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt @@ -38,6 +38,7 @@ \* CMP0131 \* CMP0142 \* CMP0154 + \* CMP0155 Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) -- GitLab