mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
Ninja: Add multi-config variant
Co-Authored-by: vector-of-bool <vectorofbool@gmail.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user