mirror of
https://github.com/reactos/CMake.git
synced 2024-12-13 06:16:49 +00:00
Merge branch 'cuda-dlink-no-deprecated-gpu' into release-3.9
This commit is contained in:
commit
fb99b0b87b
@ -186,16 +186,25 @@ if(NOT CMAKE_CUDA_LINK_EXECUTABLE)
|
||||
"<CMAKE_CUDA_HOST_LINK_LAUNCHER> <CMAKE_CUDA_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICT_LINKS}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "8.0.0")
|
||||
set(_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS "-Wno-deprecated-gpu-targets")
|
||||
else()
|
||||
set(_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS "")
|
||||
endif()
|
||||
|
||||
|
||||
#These are used when linking relocatable (dc) cuda code
|
||||
if(NOT CMAKE_CUDA_DEVICE_LINK_LIBRARY)
|
||||
set(CMAKE_CUDA_DEVICE_LINK_LIBRARY
|
||||
"<CMAKE_CUDA_COMPILER> <CMAKE_CUDA_LINK_FLAGS> <LANGUAGE_COMPILE_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
||||
"<CMAKE_CUDA_COMPILER> <CMAKE_CUDA_LINK_FLAGS> <LANGUAGE_COMPILE_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
||||
endif()
|
||||
if(NOT CMAKE_CUDA_DEVICE_LINK_EXECUTABLE)
|
||||
set(CMAKE_CUDA_DEVICE_LINK_EXECUTABLE
|
||||
"<CMAKE_CUDA_COMPILER> <FLAGS> <CMAKE_CUDA_LINK_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
||||
"<CMAKE_CUDA_COMPILER> <FLAGS> <CMAKE_CUDA_LINK_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
||||
endif()
|
||||
|
||||
unset(_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS)
|
||||
|
||||
mark_as_advanced(
|
||||
CMAKE_CUDA_FLAGS
|
||||
CMAKE_CUDA_FLAGS_RELEASE
|
||||
|
@ -30,10 +30,18 @@ set(CMAKE_CUDA_LINK_EXECUTABLE
|
||||
unset(_CMAKE_VS_LINK_EXE)
|
||||
unset(_CMAKE_VS_LINK_EXE)
|
||||
|
||||
if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "8.0.0")
|
||||
set(_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS "-Wno-deprecated-gpu-targets")
|
||||
else()
|
||||
set(_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS "")
|
||||
endif()
|
||||
|
||||
set(CMAKE_CUDA_DEVICE_LINK_LIBRARY
|
||||
"<CMAKE_CUDA_COMPILER> <CMAKE_CUDA_LINK_FLAGS> <LANGUAGE_COMPILE_FLAGS> -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS")
|
||||
"<CMAKE_CUDA_COMPILER> <CMAKE_CUDA_LINK_FLAGS> <LANGUAGE_COMPILE_FLAGS> ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS")
|
||||
set(CMAKE_CUDA_DEVICE_LINK_EXECUTABLE
|
||||
"<CMAKE_CUDA_COMPILER> <FLAGS> <CMAKE_CUDA_LINK_FLAGS> -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS")
|
||||
"<CMAKE_CUDA_COMPILER> <FLAGS> <CMAKE_CUDA_LINK_FLAGS> ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS")
|
||||
|
||||
unset(_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS)
|
||||
|
||||
string(REPLACE "/D" "-D" _PLATFORM_DEFINES_CUDA "${_PLATFORM_DEFINES}${_PLATFORM_DEFINES_CXX}")
|
||||
|
||||
|
@ -2591,6 +2591,13 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaLinkOptions(
|
||||
cudaLinkOptions.AddFlag("PerformDeviceLink",
|
||||
doDeviceLinking ? "true" : "false");
|
||||
|
||||
// Suppress deprecation warnings for default GPU targets during device link.
|
||||
if (cmSystemTools::VersionCompareGreaterEq(
|
||||
this->GlobalGenerator->GetPlatformToolsetCudaString(), "8.0")) {
|
||||
cudaLinkOptions.AppendFlag("AdditionalOptions",
|
||||
"-Wno-deprecated-gpu-targets");
|
||||
}
|
||||
|
||||
this->CudaLinkOptions[configName] = pOptions.release();
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user