summaryrefslogtreecommitdiffstats
path: root/Source/cmCommonTargetGenerator.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2019-11-15 18:01:36 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2019-12-13 15:51:46 (GMT)
commit5a8a9f72293ab1b3fd768ff40e5fb1f07cdb7dd2 (patch)
tree7e456292c9299223c3bd851261595f24371d2f3b /Source/cmCommonTargetGenerator.cxx
parent3bc63e99e44b3ef82c19d018f939ea839882a131 (diff)
downloadCMake-5a8a9f72293ab1b3fd768ff40e5fb1f07cdb7dd2.zip
CMake-5a8a9f72293ab1b3fd768ff40e5fb1f07cdb7dd2.tar.gz
CMake-5a8a9f72293ab1b3fd768ff40e5fb1f07cdb7dd2.tar.bz2
Ninja: Add multi-config variant
Co-Authored-by: vector-of-bool <vectorofbool@gmail.com>
Diffstat (limited to 'Source/cmCommonTargetGenerator.cxx')
-rw-r--r--Source/cmCommonTargetGenerator.cxx25
1 files changed, 15 insertions, 10 deletions
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index 6c7d9e8..9106e70 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -99,15 +99,15 @@ void cmCommonTargetGenerator::AppendFortranFormatFlags(
std::string cmCommonTargetGenerator::GetFlags(const std::string& l,
const std::string& config)
{
- auto i = this->FlagsByLanguage.find(l);
- if (i == this->FlagsByLanguage.end()) {
+ auto i = this->Configs[config].FlagsByLanguage.find(l);
+ if (i == this->Configs[config].FlagsByLanguage.end()) {
std::string flags;
this->LocalCommonGenerator->GetTargetCompileFlags(this->GeneratorTarget,
config, l, flags);
ByLanguageMap::value_type entry(l, flags);
- i = this->FlagsByLanguage.insert(entry).first;
+ i = this->Configs[config].FlagsByLanguage.insert(entry).first;
}
return i->second;
}
@@ -115,8 +115,8 @@ std::string cmCommonTargetGenerator::GetFlags(const std::string& l,
std::string cmCommonTargetGenerator::GetDefines(const std::string& l,
const std::string& config)
{
- auto i = this->DefinesByLanguage.find(l);
- if (i == this->DefinesByLanguage.end()) {
+ auto i = this->Configs[config].DefinesByLanguage.find(l);
+ if (i == this->Configs[config].DefinesByLanguage.end()) {
std::set<std::string> defines;
this->LocalCommonGenerator->GetTargetDefines(this->GeneratorTarget, config,
l, defines);
@@ -125,7 +125,7 @@ std::string cmCommonTargetGenerator::GetDefines(const std::string& l,
this->LocalCommonGenerator->JoinDefines(defines, definesString, l);
ByLanguageMap::value_type entry(l, definesString);
- i = this->DefinesByLanguage.insert(entry).first;
+ i = this->Configs[config].DefinesByLanguage.insert(entry).first;
}
return i->second;
}
@@ -133,12 +133,12 @@ std::string cmCommonTargetGenerator::GetDefines(const std::string& l,
std::string cmCommonTargetGenerator::GetIncludes(std::string const& l,
const std::string& config)
{
- auto i = this->IncludesByLanguage.find(l);
- if (i == this->IncludesByLanguage.end()) {
+ auto i = this->Configs[config].IncludesByLanguage.find(l);
+ if (i == this->Configs[config].IncludesByLanguage.end()) {
std::string includes;
this->AddIncludeFlags(includes, l, config);
ByLanguageMap::value_type entry(l, includes);
- i = this->IncludesByLanguage.insert(entry).first;
+ i = this->Configs[config].IncludesByLanguage.insert(entry).first;
}
return i->second;
}
@@ -182,7 +182,12 @@ std::string cmCommonTargetGenerator::ComputeTargetCompilePDB(
if (compilePdbPath.empty()) {
// Match VS default: `$(IntDir)vc$(PlatformToolsetVersion).pdb`.
// A trailing slash tells the toolchain to add its default file name.
- compilePdbPath = this->GeneratorTarget->GetSupportDirectory() + "/";
+ compilePdbPath = this->GeneratorTarget->GetSupportDirectory();
+ if (this->GlobalCommonGenerator->IsMultiConfig()) {
+ compilePdbPath += "/";
+ compilePdbPath += config;
+ }
+ compilePdbPath += "/";
if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) {
// Match VS default for static libs: `$(IntDir)$(ProjectName).pdb`.
compilePdbPath += this->GeneratorTarget->GetName();