CUDA, HIP: Revert false support for LINKER_LAUNCHER

The implementation in commits 77312cc6 (CUDA: Add support for
[CMAKE_]CUDA_LINKER_LAUNCHER, 2025-05-30, v4.1.0-rc1~80^2~1) and
cdf2a36f (HIP: Add support for [CMAKE_]HIP_LINKER_LAUNCHER, 2025-05-30,
v4.1.0-rc1~80^2) is broken, and the tests are wrongly configured
so as to never actually run. Revert the entire feature to avoid future
confusion, including documented support.

Enable the test for Fortran, which was added but untested by commit
d176a8c5ce (Fortran: Add support for [CMAKE_]Fortran_LINKER_LAUNCHER,
2025-05-26, v4.1.0-rc1~96^2), and whose implementation works.

Issue: #26967
This commit is contained in:
Tyler Yankee
2026-09-17 18:07:42 -04:00
parent 03779318b8
commit b63bcda722
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
@@ -458,11 +458,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
@@ -1298,29 +1298,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;
}