diff options
author | Brad King <brad.king@kitware.com> | 2020-05-21 14:05:09 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-05-22 12:15:32 (GMT) |
commit | 4468acb979d04fc422a1c78a89c24a26b35f3629 (patch) | |
tree | 5bd15416fde53ba8a87dd2f0debe189944737957 /Source/cmVisualStudioGeneratorOptions.cxx | |
parent | fa6db3738a61d341132aa091becd39ddf75a2bec (diff) | |
download | CMake-4468acb979d04fc422a1c78a89c24a26b35f3629.zip CMake-4468acb979d04fc422a1c78a89c24a26b35f3629.tar.gz CMake-4468acb979d04fc422a1c78a89c24a26b35f3629.tar.bz2 |
CUDA: Factor runtime library lookup into helper method
Diffstat (limited to 'Source/cmVisualStudioGeneratorOptions.cxx')
-rw-r--r-- | Source/cmVisualStudioGeneratorOptions.cxx | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index 7775f62..88ca92d 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -157,21 +157,14 @@ void cmVisualStudioGeneratorOptions::FixCudaRuntime(cmGeneratorTarget* target) this->FlagMap.find("CudaRuntime"); if (i == this->FlagMap.end()) { // User didn't provide am override so get the property value - cmProp runtimeLibraryValue = target->GetProperty("CUDA_RUNTIME_LIBRARY"); - if (runtimeLibraryValue) { - std::string cudaRuntime = - cmSystemTools::UpperCase(cmGeneratorExpression::Evaluate( - *runtimeLibraryValue, this->LocalGenerator, this->Configuration, - target)); - if (cudaRuntime == "STATIC") { - this->AddFlag("CudaRuntime", "Static"); - } - if (cudaRuntime == "SHARED") { - this->AddFlag("CudaRuntime", "Shared"); - } - if (cudaRuntime == "NONE") { - this->AddFlag("CudaRuntime", "None"); - } + 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"); |