gitlab-ci: test CMAKE_CXX_STDLIB_MODULES_JSON in CI

Do this by relocating the file to a sibling directory so that its `../`
contents continue to find the correct module interface files, but it
won't be found by default.
This commit is contained in:
Ben Boeckel 2025-09-11 16:13:35 -04:00
parent 42621a232b
commit 85e536b5eb
3 changed files with 30 additions and 0 deletions

View File

@ -478,6 +478,16 @@ t:hip6.3-radeon:
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
t:linux-gcc-cxx-modules-reloc-ninja:
extends:
- .gcc_cxx_modules_reloc_ninja
- .cmake_test_linux_release
- .linux_x86_64_tags
- .run_dependent
- .needs_centos7_x86_64
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
t:linux-gcc-cxx-modules-ninja:
extends:
- .gcc_cxx_modules_ninja

View File

@ -0,0 +1,13 @@
# "Misplace" the `libstdc++.modules.json` file so that
# `CMAKE_CXX_STDLIB_MODULES_JSON` is needed to use `import std`.
set(gcc_prefix "/opt/gcc-importstd")
set(CMake_TEST_CXX_STDLIB_MODULES_JSON
"${gcc_prefix}/lib64/libstdc++.modules.json"
CACHE FILEPATH "")
file(MAKE_DIRECTORY
"${gcc_prefix}/lib64.reloc")
file(RENAME
"${gcc_prefix}/lib64/libstdc++.modules.json"
"${CMake_TEST_CXX_STDLIB_MODULES_JSON}")
include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")

View File

@ -524,6 +524,13 @@
variables:
CMAKE_CONFIGURATION: linux_gcc_cxx_modules_ninja
.gcc_cxx_modules_reloc_ninja:
extends: .gcc_cxx_modules_x86_64
variables:
CMAKE_CONFIGURATION: linux_gcc_cxx_modules_reloc_ninja
CTEST_LABELS: "CXXModules"
.gcc_cxx_modules_ninja_multi:
extends: .gcc_cxx_modules_x86_64