mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-04 05:10:10 -05:00
Refactor target COMPILE_OPTIONS and COMPILE_FLAGS handling
Replace the cmLocalGenerator GetCompileOptions method with an AddCompileOptions method since all call sites of the former simply append the result to a flags string anyway. Add a "lang" argument to AddCompileOptions and move the CMAKE_<LANG>_FLAGS_REGEX filter into it. Move the call sites in each generator to a location that has both the language and configuration available. In the Makefile generator this also moves the flags from build.make to flags.make where they belong.
This commit is contained in:
@@ -711,6 +711,9 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
|
||||
{
|
||||
flags += " /TP ";
|
||||
}
|
||||
|
||||
// Add the target-specific flags.
|
||||
this->AddCompileOptions(flags, &target, linkLanguage, configName);
|
||||
}
|
||||
|
||||
if(this->FortranProject)
|
||||
@@ -723,15 +726,6 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
|
||||
}
|
||||
}
|
||||
|
||||
std::string targetFlags;
|
||||
this->GetCompileOptions(targetFlags, &target, configName);
|
||||
// Add the target-specific flags.
|
||||
if(!targetFlags.empty())
|
||||
{
|
||||
flags += " ";
|
||||
flags += targetFlags;
|
||||
}
|
||||
|
||||
// Get preprocessor definitions for this directory.
|
||||
std::string defineFlags = this->Makefile->GetDefineFlags();
|
||||
Options::Tool t = Options::Compiler;
|
||||
|
||||
Reference in New Issue
Block a user