summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-06-26 07:53:26 -0400
committerBrad King <brad.king@kitware.com>2019-06-26 08:36:48 -0400
commit07807a20060b4e9561239d8b26ebbb4f38b7c7f3 (patch)
treee439e9de25e8da3666f554d527cdda6b41faec9b
parent5c7880956f9b3daea561c7bf817b27aa47b53dd0 (diff)
downloadcmake-07807a20060b4e9561239d8b26ebbb4f38b7c7f3.tar.gz
VS: Use AddLanguageFlags to de-duplicate CMAKE_{CUDA,ASM*}_FLAGS lookup
Apply the refactoring from commit 707283981f (VS: Use AddLanguageFlags to de-duplicate CMAKE_<LANG>_FLAGS* lookup, 2019-04-01, v3.15.0-rc1~300^2) to the CUDA, ASM_MASM, and ASM_NASM languages too. In particular, CUDA needs the MSVC runtime library selection logic in the `AddLanguageFlags` method that is used by other generators.
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx26
1 files changed, 11 insertions, 15 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 936841446d..9586007ae1 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2910,10 +2910,9 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions(
Options& cudaOptions = *pOptions;
// Get compile flags for CUDA in this directory.
- std::string CONFIG = cmSystemTools::UpperCase(configName);
- std::string configFlagsVar = "CMAKE_CUDA_FLAGS_" + CONFIG;
- std::string flags = this->Makefile->GetSafeDefinition("CMAKE_CUDA_FLAGS") +
- " " + this->Makefile->GetSafeDefinition(configFlagsVar);
+ std::string flags;
+ this->LocalGenerator->AddLanguageFlags(flags, this->GeneratorTarget, "CUDA",
+ configName);
this->LocalGenerator->AddCompileOptions(flags, this->GeneratorTarget, "CUDA",
configName);
@@ -3114,11 +3113,9 @@ bool cmVisualStudio10TargetGenerator::ComputeMasmOptions(
this->LocalGenerator, Options::MasmCompiler, gg->GetMasmFlagTable());
Options& masmOptions = *pOptions;
- std::string CONFIG = cmSystemTools::UpperCase(configName);
- std::string configFlagsVar = "CMAKE_ASM_MASM_FLAGS_" + CONFIG;
- std::string flags =
- this->Makefile->GetSafeDefinition("CMAKE_ASM_MASM_FLAGS") + " " +
- this->Makefile->GetSafeDefinition(configFlagsVar);
+ std::string flags;
+ this->LocalGenerator->AddLanguageFlags(flags, this->GeneratorTarget,
+ "ASM_MASM", configName);
masmOptions.Parse(flags);
@@ -3168,12 +3165,11 @@ bool cmVisualStudio10TargetGenerator::ComputeNasmOptions(
this->LocalGenerator, Options::NasmCompiler, gg->GetNasmFlagTable());
Options& nasmOptions = *pOptions;
- std::string CONFIG = cmSystemTools::UpperCase(configName);
- std::string configFlagsVar = "CMAKE_ASM_NASM_FLAGS_" + CONFIG;
- std::string flags =
- this->Makefile->GetSafeDefinition("CMAKE_ASM_NASM_FLAGS") + " -f" +
- this->Makefile->GetSafeDefinition("CMAKE_ASM_NASM_OBJECT_FORMAT") + " " +
- this->Makefile->GetSafeDefinition(configFlagsVar);
+ std::string flags;
+ this->LocalGenerator->AddLanguageFlags(flags, this->GeneratorTarget,
+ "ASM_NASM", configName);
+ flags += " -f";
+ flags += this->Makefile->GetSafeDefinition("CMAKE_ASM_NASM_OBJECT_FORMAT");
nasmOptions.Parse(flags);
// Get includes for this target