diff options
-rw-r--r-- | .gitlab/ci/cxx_modules_rules_gcc.cmake | 19 | ||||
-rwxr-xr-x | .gitlab/ci/docker/gcc_cxx_modules/install_gcc.sh | 9 | ||||
-rw-r--r-- | .gitlab/os-linux.yml | 2 | ||||
-rw-r--r-- | Modules/Compiler/GNU-CXX.cmake | 21 |
4 files changed, 26 insertions, 25 deletions
diff --git a/.gitlab/ci/cxx_modules_rules_gcc.cmake b/.gitlab/ci/cxx_modules_rules_gcc.cmake index 020cb1f..2b09b0e 100644 --- a/.gitlab/ci/cxx_modules_rules_gcc.cmake +++ b/.gitlab/ci/cxx_modules_rules_gcc.cmake @@ -1,20 +1 @@ set(CMake_TEST_CXXModules_UUID "a246741c-d067-4019-a8fb-3d16b0c9d1d3") - -string(CONCAT CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE - "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E -x c++ <SOURCE>" - " -MT <DYNDEP_FILE> -MD -MF <DEP_FILE>" - " -fmodules-ts -fdeps-file=<DYNDEP_FILE> -fdeps-target=<OBJECT> -fdeps-format=p1689r5" - " -o <PREPROCESSED_SOURCE>") -set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FORMAT "gcc") -string(CONCAT CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FLAG - # Turn on modules. - "-fmodules-ts" - # Read the module mapper file. - " -fmodule-mapper=<MODULE_MAP_FILE>" - # Make sure dependency tracking is enabled (missing from `try_*`). - " -MD" - # Suppress `CXX_MODULES +=` from generated depfile snippets. - " -fdeps-format=p1689r5" - # Force C++ as a language. - " -x c++") -set(CMAKE_EXPERIMENTAL_CXX_MODULE_BMI_ONLY_FLAG "-fmodule-only") diff --git a/.gitlab/ci/docker/gcc_cxx_modules/install_gcc.sh b/.gitlab/ci/docker/gcc_cxx_modules/install_gcc.sh index 529626e..15cfe39 100755 --- a/.gitlab/ci/docker/gcc_cxx_modules/install_gcc.sh +++ b/.gitlab/ci/docker/gcc_cxx_modules/install_gcc.sh @@ -2,8 +2,8 @@ set -e -readonly revision="p1689r5-cmake-ci-20230814" # 9fd54ccc390ab4eb3c48186b7bf15e02632cc76c -readonly tarball="https://github.com/mathstuf/gcc/archive/$revision.tar.gz" +readonly revision="29862e21f6d656eca59284c927d0c4c0698eb99c" # master as of 21 Sep 2023 +readonly tarball="git://gcc.gnu.org/git/gcc.git" readonly workdir="$HOME/gcc" readonly srcdir="$workdir/gcc" @@ -12,9 +12,8 @@ readonly njobs="$( nproc )" mkdir -p "$workdir" cd "$workdir" -curl -L "$tarball" > "gcc-$revision.tar.gz" -tar xf "gcc-$revision.tar.gz" -mv "gcc-$revision" "$srcdir" +git clone "$tarball" "$srcdir" +git -C "$srcdir" checkout "$revision" mkdir -p "$builddir" cd "$builddir" "$srcdir/configure" \ diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml index d42340c..7437f12 100644 --- a/.gitlab/os-linux.yml +++ b/.gitlab/os-linux.yml @@ -383,7 +383,7 @@ ### C++ modules .gcc_cxx_modules_x86_64: - image: "kitware/cmake:ci-gcc_cxx_modules-x86_64-2023-08-15" + image: "kitware/cmake:ci-gcc_cxx_modules-x86_64-2023-09-21" variables: GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci" diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index b35f254..c276f4e 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -72,3 +72,24 @@ elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0) endif() __compiler_check_default_language_standard(CXX 3.4 98 6.0 14 11.1 17) + +if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 14.0) + string(CONCAT CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE + "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E -x c++ <SOURCE>" + " -MT <DYNDEP_FILE> -MD -MF <DEP_FILE>" + " -fmodules-ts -fdeps-file=<DYNDEP_FILE> -fdeps-target=<OBJECT> -fdeps-format=p1689r5" + " -o <PREPROCESSED_SOURCE>") + set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FORMAT "gcc") + string(CONCAT CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FLAG + # Turn on modules. + "-fmodules-ts" + # Read the module mapper file. + " -fmodule-mapper=<MODULE_MAP_FILE>" + # Make sure dependency tracking is enabled (missing from `try_*`). + " -MD" + # Suppress `CXX_MODULES +=` from generated depfile snippets. + " -fdeps-format=p1689r5" + # Force C++ as a language. + " -x c++") + set(CMAKE_EXPERIMENTAL_CXX_MODULE_BMI_ONLY_FLAG "-fmodule-only") +endif() |