mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-06 14:19:59 -05:00
CUDA: Use .obj object file extension on Windows
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
set(CMAKE_CUDA_OUTPUT_EXTENSION .o)
|
||||
if(UNIX)
|
||||
set(CMAKE_CUDA_OUTPUT_EXTENSION .o)
|
||||
else()
|
||||
set(CMAKE_CUDA_OUTPUT_EXTENSION .obj)
|
||||
endif()
|
||||
set(CMAKE_INCLUDE_FLAG_CUDA "-I")
|
||||
|
||||
# Load compiler-specific information.
|
||||
|
||||
@@ -104,10 +104,12 @@ void cmMakefileExecutableTargetGenerator::WriteDeviceExecutableRule(
|
||||
|
||||
// Get the language to use for linking this library.
|
||||
std::string linkLanguage = "CUDA";
|
||||
std::string const objExt =
|
||||
this->Makefile->GetSafeDefinition("CMAKE_CUDA_OUTPUT_EXTENSION");
|
||||
|
||||
// Get the name of the device object to generate.
|
||||
std::string const targetOutputReal =
|
||||
this->GeneratorTarget->ObjectDirectory + "cmake_device_link.o";
|
||||
this->GeneratorTarget->ObjectDirectory + "cmake_device_link" + objExt;
|
||||
this->DeviceLinkObject = targetOutputReal;
|
||||
|
||||
this->NumberOfProgressActions++;
|
||||
|
||||
@@ -281,6 +281,8 @@ void cmMakefileLibraryTargetGenerator::WriteDeviceLibraryRules(
|
||||
|
||||
// Get the language to use for linking this library.
|
||||
std::string linkLanguage = "CUDA";
|
||||
std::string const objExt =
|
||||
this->Makefile->GetSafeDefinition("CMAKE_CUDA_OUTPUT_EXTENSION");
|
||||
|
||||
// Create set of linking flags.
|
||||
std::string linkFlags;
|
||||
@@ -288,7 +290,7 @@ void cmMakefileLibraryTargetGenerator::WriteDeviceLibraryRules(
|
||||
|
||||
// Get the name of the device object to generate.
|
||||
std::string const targetOutputReal =
|
||||
this->GeneratorTarget->ObjectDirectory + "cmake_device_link.o";
|
||||
this->GeneratorTarget->ObjectDirectory + "cmake_device_link" + objExt;
|
||||
this->DeviceLinkObject = targetOutputReal;
|
||||
|
||||
this->NumberOfProgressActions++;
|
||||
|
||||
@@ -602,10 +602,12 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement()
|
||||
// First and very important step is to make sure while inside this
|
||||
// step our link language is set to CUDA
|
||||
std::string cudaLinkLanguage = "CUDA";
|
||||
std::string const objExt =
|
||||
this->Makefile->GetSafeDefinition("CMAKE_CUDA_OUTPUT_EXTENSION");
|
||||
|
||||
std::string const cfgName = this->GetConfigName();
|
||||
std::string const targetOutputReal =
|
||||
ConvertToNinjaPath(genTarget.ObjectDirectory + "cmake_device_link.o");
|
||||
std::string const targetOutputReal = ConvertToNinjaPath(
|
||||
genTarget.ObjectDirectory + "cmake_device_link" + objExt);
|
||||
|
||||
std::string const targetOutputImplib =
|
||||
ConvertToNinjaPath(genTarget.GetFullPath(cfgName,
|
||||
|
||||
Reference in New Issue
Block a user