Merge branch 'backport-test-langs-launchers' into test-langs-launchers

This commit is contained in:
Tyler Yankee
2026-09-17 18:08:42 -04:00
27 changed files with 18 additions and 94 deletions
-12
View File
@@ -6,25 +6,13 @@
This property is implemented only when ``<LANG>`` is one of:
* ``C``
* ``CXX``
* ``CUDA``
.. versionadded:: 4.1
* ``OBJC``
* ``OBJCXX``
* ``Fortran``
.. versionadded:: 4.1
* ``HIP``
.. versionadded:: 4.1
Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing a
command line for a linker launching tool. The :ref:`Makefile Generators` and the
:generator:`Ninja` generator will run this tool and pass the linker and its
+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.
@@ -11,10 +11,6 @@ This is done only when ``<LANG>`` is one of:
* ``CXX``
* ``CUDA``
.. versionadded:: 4.1
* ``OBJC``
* ``OBJCXX``
@@ -23,9 +19,5 @@ This is done only when ``<LANG>`` is one of:
.. versionadded:: 4.1
* ``HIP``
.. versionadded:: 4.1
This variable is initialized to the :envvar:`CMAKE_<LANG>_LINKER_LAUNCHER`
environment variable if it is set.
-5
View File
@@ -75,11 +75,6 @@ if(NOT CMAKE_CUDA_COMPILER_LAUNCHER AND DEFINED ENV{CMAKE_CUDA_COMPILER_LAUNCHER
CACHE STRING "Compiler launcher for CUDA.")
endif()
if(NOT CMAKE_CUDA_LINKER_LAUNCHER AND DEFINED ENV{CMAKE_CUDA_LINKER_LAUNCHER})
set(CMAKE_CUDA_LINKER_LAUNCHER "$ENV{CMAKE_CUDA_LINKER_LAUNCHER}"
CACHE STRING "Linker launcher for CUDA.")
endif()
include(CMakeCommonLanguageInclude)
_cmake_common_language_platform_flags(CUDA)
-5
View File
@@ -55,11 +55,6 @@ if(NOT CMAKE_HIP_COMPILER_LAUNCHER AND DEFINED ENV{CMAKE_HIP_COMPILER_LAUNCHER})
CACHE STRING "Compiler launcher for HIP.")
endif()
if(NOT CMAKE_HIP_LINKER_LAUNCHER AND DEFINED ENV{CMAKE_HIP_LINKER_LAUNCHER})
set(CMAKE_HIP_LINKER_LAUNCHER "$ENV{CMAKE_HIP_LINKER_LAUNCHER}"
CACHE STRING "Linker launcher for HIP.")
endif()
include(CMakeCommonLanguageInclude)
_cmake_common_language_platform_flags(HIP)
-2
View File
@@ -464,11 +464,9 @@ TargetProperty const StaticTargetProperties[] = {
// ---- C++
{ "CXX_LINKER_LAUNCHER"_s, IC::CanCompileSources },
// ---- CUDA
{ "CUDA_LINKER_LAUNCHER"_s, IC::CanCompileSources },
{ "CUDA_RESOLVE_DEVICE_SYMBOLS"_s, IC::CanCompileSources },
{ "CUDA_RUNTIME_LIBRARY"_s, IC::CanCompileSources },
// ---- HIP
{ "HIP_LINKER_LAUNCHER"_s, IC::CanCompileSources },
{ "HIP_RUNTIME_LIBRARY"_s, IC::CanCompileSources },
// ---- Objective C
{ "OBJC_LINKER_LAUNCHER"_s, IC::CanCompileSources },
+17 -13
View File
@@ -1336,29 +1336,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_OBJC)
list(APPEND LauncherCommon_ARGS -DCMake_TEST_OBJC=${CMake_TEST_OBJC})
endif()
if(CMAKE_Fortran_COMPILER)
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()
if(DEFINED CMake_TEST_CUDA)
list(APPEND CompilerLauncher_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})
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})
endif()
if(CMAKE_Fortran_COMPILER)
list(APPEND CompilerLauncher_ARGS -DCMake_TEST_Fortran=1)
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 LABELS "Fortran")
endif()
set(cpack_tests
@@ -1 +0,0 @@
.*-E env USED_LAUNCHER=1.*
@@ -1,4 +0,0 @@
cmake_policy(SET CMP0104 NEW)
enable_language(CUDA)
set(CMAKE_VERBOSE_MAKEFILE TRUE)
add_executable(main main.cu)
@@ -1 +0,0 @@
.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=CUDA.*
@@ -1 +0,0 @@
include(CUDA-common.cmake)
@@ -1 +0,0 @@
.*-E env USED_LAUNCHER=1.*
@@ -1 +0,0 @@
.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=CUDA.*
@@ -1,3 +0,0 @@
set(CTEST_USE_LAUNCHERS 1)
include(CTestUseLaunchers)
include(CUDA-env.cmake)
@@ -1,3 +0,0 @@
set(CTEST_USE_LAUNCHERS 1)
include(CTestUseLaunchers)
include(CUDA.cmake)
-2
View File
@@ -1,2 +0,0 @@
set(CMAKE_CUDA_LINKER_LAUNCHER "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1")
include(CUDA-common.cmake)
@@ -1,5 +0,0 @@
enable_language(HIP)
enable_language(CXX)
set(CMAKE_VERBOSE_MAKEFILE TRUE)
add_executable(main main.hip)
@@ -1 +0,0 @@
.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=HIP.*
@@ -1 +0,0 @@
include(HIP-common.cmake)
@@ -1 +0,0 @@
.*-E env USED_LAUNCHER=1.*
@@ -1 +0,0 @@
.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=HIP.*
@@ -1,3 +0,0 @@
set(CTEST_USE_LAUNCHERS 1)
include(CTestUseLaunchers)
include(HIP-env.cmake)
@@ -1,3 +0,0 @@
set(CTEST_USE_LAUNCHERS 1)
include(CTestUseLaunchers)
include(HIP.cmake)
-2
View File
@@ -1,2 +0,0 @@
set(CMAKE_HIP_LINKER_LAUNCHER "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1")
include(HIP-common.cmake)
@@ -27,15 +27,9 @@ function(run_linker_launcher_env lang)
endfunction()
set(langs C CXX)
if(CMake_TEST_CUDA)
list(APPEND langs CUDA)
endif()
if(CMake_TEST_Fortran)
list(APPEND langs Fortran)
endif()
if(CMake_TEST_HIP)
list(APPEND langs HIP)
endif()
if(CMake_TEST_OBJC)
list(APPEND langs OBJC OBJCXX)
endif()
-4
View File
@@ -1,4 +0,0 @@
int main()
{
return 0;
}
-4
View File
@@ -1,4 +0,0 @@
int main()
{
return 0;
}