mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-18 05:01:50 -06:00
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.
This commit is contained in:
@@ -2910,10 +2910,9 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions(
|
|||||||
Options& cudaOptions = *pOptions;
|
Options& cudaOptions = *pOptions;
|
||||||
|
|
||||||
// Get compile flags for CUDA in this directory.
|
// Get compile flags for CUDA in this directory.
|
||||||
std::string CONFIG = cmSystemTools::UpperCase(configName);
|
std::string flags;
|
||||||
std::string configFlagsVar = "CMAKE_CUDA_FLAGS_" + CONFIG;
|
this->LocalGenerator->AddLanguageFlags(flags, this->GeneratorTarget, "CUDA",
|
||||||
std::string flags = this->Makefile->GetSafeDefinition("CMAKE_CUDA_FLAGS") +
|
configName);
|
||||||
" " + this->Makefile->GetSafeDefinition(configFlagsVar);
|
|
||||||
this->LocalGenerator->AddCompileOptions(flags, this->GeneratorTarget, "CUDA",
|
this->LocalGenerator->AddCompileOptions(flags, this->GeneratorTarget, "CUDA",
|
||||||
configName);
|
configName);
|
||||||
|
|
||||||
@@ -3114,11 +3113,9 @@ bool cmVisualStudio10TargetGenerator::ComputeMasmOptions(
|
|||||||
this->LocalGenerator, Options::MasmCompiler, gg->GetMasmFlagTable());
|
this->LocalGenerator, Options::MasmCompiler, gg->GetMasmFlagTable());
|
||||||
Options& masmOptions = *pOptions;
|
Options& masmOptions = *pOptions;
|
||||||
|
|
||||||
std::string CONFIG = cmSystemTools::UpperCase(configName);
|
std::string flags;
|
||||||
std::string configFlagsVar = "CMAKE_ASM_MASM_FLAGS_" + CONFIG;
|
this->LocalGenerator->AddLanguageFlags(flags, this->GeneratorTarget,
|
||||||
std::string flags =
|
"ASM_MASM", configName);
|
||||||
this->Makefile->GetSafeDefinition("CMAKE_ASM_MASM_FLAGS") + " " +
|
|
||||||
this->Makefile->GetSafeDefinition(configFlagsVar);
|
|
||||||
|
|
||||||
masmOptions.Parse(flags);
|
masmOptions.Parse(flags);
|
||||||
|
|
||||||
@@ -3168,12 +3165,11 @@ bool cmVisualStudio10TargetGenerator::ComputeNasmOptions(
|
|||||||
this->LocalGenerator, Options::NasmCompiler, gg->GetNasmFlagTable());
|
this->LocalGenerator, Options::NasmCompiler, gg->GetNasmFlagTable());
|
||||||
Options& nasmOptions = *pOptions;
|
Options& nasmOptions = *pOptions;
|
||||||
|
|
||||||
std::string CONFIG = cmSystemTools::UpperCase(configName);
|
std::string flags;
|
||||||
std::string configFlagsVar = "CMAKE_ASM_NASM_FLAGS_" + CONFIG;
|
this->LocalGenerator->AddLanguageFlags(flags, this->GeneratorTarget,
|
||||||
std::string flags =
|
"ASM_NASM", configName);
|
||||||
this->Makefile->GetSafeDefinition("CMAKE_ASM_NASM_FLAGS") + " -f" +
|
flags += " -f";
|
||||||
this->Makefile->GetSafeDefinition("CMAKE_ASM_NASM_OBJECT_FORMAT") + " " +
|
flags += this->Makefile->GetSafeDefinition("CMAKE_ASM_NASM_OBJECT_FORMAT");
|
||||||
this->Makefile->GetSafeDefinition(configFlagsVar);
|
|
||||||
nasmOptions.Parse(flags);
|
nasmOptions.Parse(flags);
|
||||||
|
|
||||||
// Get includes for this target
|
// Get includes for this target
|
||||||
|
|||||||
Reference in New Issue
Block a user