mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
Merge topic 'test-langs-launchers'
584a9297c0CUDA, HIP: Restore support for LINKER_LAUNCHERaeb7c3295dMerge branch 'backport-test-langs-launchers' into test-langs-launchersb63bcda722CUDA, 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:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user