From 291c83f063d310f700e3e1afa756dcdf968d0f09 Mon Sep 17 00:00:00 2001 From: Justin Goshi Date: Tue, 3 Sep 2019 10:25:44 -0700 Subject: cmLocalGenerator: Add GetTargetCompileFlags overload with backtraces --- Source/cmLocalGenerator.cxx | 16 ++++++++++++++-- Source/cmLocalGenerator.h | 3 +++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index b73f5d2..bc1ff1f 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1382,6 +1382,16 @@ void cmLocalGenerator::GetTargetCompileFlags(cmGeneratorTarget* target, std::string const& lang, std::string& flags) { + std::vector> tmpFlags = + this->GetTargetCompileFlags(target, config, lang); + this->AppendFlags(flags, tmpFlags); +} + +std::vector> cmLocalGenerator::GetTargetCompileFlags( + cmGeneratorTarget* target, std::string const& config, + std::string const& lang) +{ + std::vector> flags; std::string compileFlags; cmMakefile* mf = this->GetMakefile(); @@ -1406,9 +1416,11 @@ void cmLocalGenerator::GetTargetCompileFlags(cmGeneratorTarget* target, this->AppendFlags(compileFlags, this->GetFrameworkFlags(lang, config, target)); - flags = std::move(compileFlags); - + if (!compileFlags.empty()) { + flags.emplace_back(std::move(compileFlags)); + } this->AddCompileOptions(flags, target, lang, config); + return flags; } static std::string GetFrameworkFlags(const std::string& lang, diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 89472e0..34f58bd 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -397,6 +397,9 @@ public: void GetTargetCompileFlags(cmGeneratorTarget* target, std::string const& config, std::string const& lang, std::string& flags); + std::vector> GetTargetCompileFlags(cmGeneratorTarget* target, + std::string const& config, + std::string const& lang); std::string GetFrameworkFlags(std::string const& l, std::string const& config, -- cgit v0.12