mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-01 19:30:13 -06:00
CUDA: Move VS CudaRuntime selection to be with rest of CUDA options
This commit is contained in:
@@ -3130,6 +3130,17 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions(
|
||||
cudaOptions.AddIncludes(this->GetIncludes(configName, "CUDA"));
|
||||
cudaOptions.AddFlag("UseHostInclude", "false");
|
||||
|
||||
// Add runtime library selection flag.
|
||||
std::string const& cudaRuntime =
|
||||
this->GeneratorTarget->GetRuntimeLinkLibrary("CUDA", configName);
|
||||
if (cudaRuntime == "STATIC") {
|
||||
cudaOptions.AddFlag("CudaRuntime", "Static");
|
||||
} else if (cudaRuntime == "SHARED") {
|
||||
cudaOptions.AddFlag("CudaRuntime", "Shared");
|
||||
} else if (cudaRuntime == "NONE") {
|
||||
cudaOptions.AddFlag("CudaRuntime", "None");
|
||||
}
|
||||
|
||||
this->CudaOptions[configName] = std::move(pOptions);
|
||||
return true;
|
||||
}
|
||||
@@ -3644,10 +3655,6 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
|
||||
std::vector<std::string> libVec;
|
||||
std::vector<std::string> vsTargetVec;
|
||||
this->AddLibraries(cli, libVec, vsTargetVec, config);
|
||||
if (cm::contains(linkClosure->Languages, "CUDA") &&
|
||||
this->CudaOptions[config] != nullptr) {
|
||||
this->CudaOptions[config]->FixCudaRuntime(this->GeneratorTarget);
|
||||
}
|
||||
std::string standardLibsVar =
|
||||
cmStrCat("CMAKE_", linkLanguage, "_STANDARD_LIBRARIES");
|
||||
std::string const& libs = this->Makefile->GetSafeDefinition(standardLibsVar);
|
||||
|
||||
@@ -151,27 +151,6 @@ bool cmVisualStudioGeneratorOptions::UsingSBCS() const
|
||||
return false;
|
||||
}
|
||||
|
||||
void cmVisualStudioGeneratorOptions::FixCudaRuntime(cmGeneratorTarget* target)
|
||||
{
|
||||
std::map<std::string, FlagValue>::const_iterator i =
|
||||
this->FlagMap.find("CudaRuntime");
|
||||
if (i == this->FlagMap.end()) {
|
||||
// User didn't provide am override so get the property value
|
||||
std::string const& cudaRuntime =
|
||||
target->GetRuntimeLinkLibrary("CUDA", this->Configuration);
|
||||
if (cudaRuntime == "STATIC") {
|
||||
this->AddFlag("CudaRuntime", "Static");
|
||||
} else if (cudaRuntime == "SHARED") {
|
||||
this->AddFlag("CudaRuntime", "Shared");
|
||||
} else if (cudaRuntime == "NONE") {
|
||||
this->AddFlag("CudaRuntime", "None");
|
||||
} else {
|
||||
// nvcc default is static
|
||||
this->AddFlag("CudaRuntime", "Static");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cmVisualStudioGeneratorOptions::FixCudaCodeGeneration()
|
||||
{
|
||||
// Extract temporary values stored by our flag table.
|
||||
|
||||
@@ -63,7 +63,6 @@ public:
|
||||
bool UsingSBCS() const;
|
||||
|
||||
void FixCudaCodeGeneration();
|
||||
void FixCudaRuntime(cmGeneratorTarget* target);
|
||||
|
||||
void FixManifestUACFlags();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user