summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-05-22 11:01:55 (GMT)
committerBrad King <brad.king@kitware.com>2020-05-22 12:15:37 (GMT)
commit5c7ca6f8a87f8c673088103a4d00a176f8cd93fe (patch)
tree9baf40ea74d319f0f9cede1eec8dfe9da37e5438 /Source
parent4468acb979d04fc422a1c78a89c24a26b35f3629 (diff)
downloadCMake-5c7ca6f8a87f8c673088103a4d00a176f8cd93fe.zip
CMake-5c7ca6f8a87f8c673088103a4d00a176f8cd93fe.tar.gz
CMake-5c7ca6f8a87f8c673088103a4d00a176f8cd93fe.tar.bz2
CUDA: Move VS CudaRuntime selection to be with rest of CUDA options
Diffstat (limited to 'Source')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx15
-rw-r--r--Source/cmVisualStudioGeneratorOptions.cxx21
-rw-r--r--Source/cmVisualStudioGeneratorOptions.h1
3 files changed, 11 insertions, 26 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 97f7093..de88182 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -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);
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index 88ca92d..937b4ce 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -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.
diff --git a/Source/cmVisualStudioGeneratorOptions.h b/Source/cmVisualStudioGeneratorOptions.h
index b335694..f9b50a7 100644
--- a/Source/cmVisualStudioGeneratorOptions.h
+++ b/Source/cmVisualStudioGeneratorOptions.h
@@ -63,7 +63,6 @@ public:
bool UsingSBCS() const;
void FixCudaCodeGeneration();
- void FixCudaRuntime(cmGeneratorTarget* target);
void FixManifestUACFlags();