Merge topic 'test-langs-launchers'

584a9297c0 CUDA, HIP: Restore support for LINKER_LAUNCHER
aeb7c3295d Merge branch 'backport-test-langs-launchers' into test-langs-launchers
b63bcda722 CUDA, HIP: Revert false support for LINKER_LAUNCHER

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !12519
This commit is contained in:
Brad King
2026-09-21 11:28:32 -04:00
committed by Kitware Robot
6 changed files with 40 additions and 16 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ This property is implemented only when ``<LANG>`` is one of:
* ``CUDA``
.. versionadded:: 4.1
.. versionadded:: 4.5
* ``OBJC``
@@ -23,7 +23,7 @@ This property is implemented only when ``<LANG>`` is one of:
* ``HIP``
.. versionadded:: 4.1
.. versionadded:: 4.5
Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing a
command line for a linker launching tool. The :ref:`Makefile Generators` and the
+1 -1
View File
@@ -21,7 +21,7 @@ Generators
----------
* :ref:`Makefile Generators` and :ref:`Ninja Generators` gained support
for adding a linker launcher with ``Fortran``, ``CUDA``, and ``HIP``.
for adding a linker launcher with ``Fortran``.
See the :variable:`CMAKE_<LANG>_LINKER_LAUNCHER` variable
and :prop_tgt:`<LANG>_LINKER_LAUNCHER` target property for details.
@@ -0,0 +1,7 @@
cuda-hip-linker-launcher
------------------------
* :ref:`Makefile Generators` and :ref:`Ninja Generators` gained support
for adding a linker launcher with ``CUDA`` and ``HIP``.
See the :variable:`CMAKE_<LANG>_LINKER_LAUNCHER` variable
and :prop_tgt:`<LANG>_LINKER_LAUNCHER` target property for details.
+2 -2
View File
@@ -13,7 +13,7 @@ This is done only when ``<LANG>`` is one of:
* ``CUDA``
.. versionadded:: 4.1
.. versionadded:: 4.5
* ``OBJC``
@@ -25,7 +25,7 @@ This is done only when ``<LANG>`` is one of:
* ``HIP``
.. versionadded:: 4.1
.. versionadded:: 4.5
This variable is initialized to the :envvar:`CMAKE_<LANG>_LINKER_LAUNCHER`
environment variable if it is set.
+13
View File
@@ -54,6 +54,19 @@ std::string cmRulePlaceholderExpander::ExpandVariable(
return result;
}
}
if (this->ReplaceValues->Language && this->ReplaceValues->Launcher &&
variable ==
cmStrCat("CMAKE_", this->ReplaceValues->Language,
"_HOST_LINK_LAUNCHER")) {
auto mapIt = this->VariableMappings.find(variable);
std::string result = mapIt != this->VariableMappings.end()
? this->ConvertToOutputForExisting(mapIt->second)
: variable;
// Add launcher as part of expansion so that it always appears
// immediately before the command itself, regardless of whether the
// overall rule template contains other content at the front.
return cmStrCat(this->ReplaceValues->Launcher, ' ', result);
}
if (this->ReplaceValues->Manifests) {
if (variable == "MANIFESTS") {
return this->ReplaceValues->Manifests;
+15 -11
View File
@@ -1337,29 +1337,33 @@ if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja|FASTBuild")
-DPSEUDO_CPPCHECK=$<TARGET_FILE:pseudo_cppcheck>
)
add_RunCMake_test(ctest_labels_for_subprojects)
add_RunCMake_test(CompilerArgs)
# Enable supported languages for {Compiler,Linker}Launcher.
if(DEFINED CMake_TEST_CUDA)
list(APPEND CompilerLauncher_ARGS -DCMake_TEST_CUDA=${CMake_TEST_CUDA})
list(APPEND LauncherCommon_ARGS -DCMake_TEST_CUDA=${CMake_TEST_CUDA})
endif()
if(DEFINED CMake_TEST_HIP)
list(APPEND CompilerLauncher_ARGS -DCMake_TEST_HIP=${CMake_TEST_HIP})
endif()
if(DEFINED CMake_TEST_ISPC)
list(APPEND CompilerLauncher_ARGS -DCMake_TEST_ISPC=${CMake_TEST_ISPC})
list(APPEND LauncherCommon_ARGS -DCMake_TEST_HIP=${CMake_TEST_HIP})
endif()
if(DEFINED CMake_TEST_OBJC)
list(APPEND CompilerLauncher_ARGS -DCMake_TEST_OBJC=${CMake_TEST_OBJC})
list(APPEND LinkerLauncher_ARGS -DCMake_TEST_OBJC=${CMake_TEST_OBJC})
list(APPEND LauncherCommon_ARGS -DCMake_TEST_OBJC=${CMake_TEST_OBJC})
endif()
if(CMAKE_Fortran_COMPILER)
list(APPEND CompilerLauncher_ARGS -DCMake_TEST_Fortran=1)
list(APPEND LauncherCommon_ARGS -DCMake_TEST_Fortran=1)
endif()
set(CompilerLauncher_ARGS ${LauncherCommon_ARGS})
set(LinkerLauncher_ARGS ${LauncherCommon_ARGS})
if(DEFINED CMake_TEST_ISPC)
list(APPEND CompilerLauncher_ARGS -DCMake_TEST_ISPC=${CMake_TEST_ISPC})
endif()
add_RunCMake_test(CompilerLauncher)
set_property(TEST RunCMake.CompilerLauncher APPEND
PROPERTY LABELS "CUDA" "HIP" "ISPC" "Fortran")
add_RunCMake_test(ctest_labels_for_subprojects)
add_RunCMake_test(CompilerArgs)
add_RunCMake_test(LinkerLauncher)
set_property(TEST RunCMake.LinkerLauncher APPEND
PROPERTY LABEL "CUDA" "HIP" "Fortran")
endif()
set(cpack_tests