summaryrefslogtreecommitdiffstats
path: root/Source/cmFileAPICodemodel.cxx
diff options
context:
space:
mode:
authorJustin Goshi <jgoshi@microsoft.com>2019-09-03 17:25:44 (GMT)
committerBrad King <brad.king@kitware.com>2019-09-10 14:45:41 (GMT)
commit30006e199bb6ac3649332b26c94ccf864e1416b1 (patch)
tree934a3e560fdac973cb33ff235ba6ef9951049db0 /Source/cmFileAPICodemodel.cxx
parent291c83f063d310f700e3e1afa756dcdf968d0f09 (diff)
downloadCMake-30006e199bb6ac3649332b26c94ccf864e1416b1.zip
CMake-30006e199bb6ac3649332b26c94ccf864e1416b1.tar.gz
CMake-30006e199bb6ac3649332b26c94ccf864e1416b1.tar.bz2
fileapi: add backtraces for compile/link options
Diffstat (limited to 'Source/cmFileAPICodemodel.cxx')
-rw-r--r--Source/cmFileAPICodemodel.cxx20
1 files changed, 13 insertions, 7 deletions
diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx
index 3ac769c..805da81 100644
--- a/Source/cmFileAPICodemodel.cxx
+++ b/Source/cmFileAPICodemodel.cxx
@@ -802,9 +802,13 @@ void Target::ProcessLanguage(std::string const& lang)
{
// FIXME: Add flags from end section of ExpandRuleVariable,
// which may need to be factored out.
- std::string flags;
- lg->GetTargetCompileFlags(this->GT, this->Config, lang, flags);
- cd.Flags.emplace_back(std::move(flags), JBTIndex());
+ std::vector<BT<std::string>> flags =
+ lg->GetTargetCompileFlags(this->GT, this->Config, lang);
+
+ cd.Flags.reserve(flags.size());
+ for (const BT<std::string>& f : flags) {
+ cd.Flags.emplace_back(this->ToJBT(f));
+ }
}
std::set<BT<std::string>> defines =
lg->GetTargetDefines(this->GT, this->Config, lang);
@@ -1264,7 +1268,7 @@ Json::Value Target::DumpLinkCommandFragments()
Json::Value linkFragments = Json::arrayValue;
std::string linkLanguageFlags;
- std::string linkFlags;
+ std::vector<BT<std::string>> linkFlags;
std::string frameworkPath;
std::string linkPath;
std::string linkLibs;
@@ -1275,7 +1279,6 @@ Json::Value Target::DumpLinkCommandFragments()
linkLanguageFlags, linkFlags, frameworkPath, linkPath,
this->GT);
linkLanguageFlags = cmTrimWhitespace(linkLanguageFlags);
- linkFlags = cmTrimWhitespace(linkFlags);
frameworkPath = cmTrimWhitespace(frameworkPath);
linkPath = cmTrimWhitespace(linkPath);
linkLibs = cmTrimWhitespace(linkLibs);
@@ -1286,8 +1289,11 @@ Json::Value Target::DumpLinkCommandFragments()
}
if (!linkFlags.empty()) {
- linkFragments.append(
- this->DumpCommandFragment(std::move(linkFlags), "flags"));
+ for (BT<std::string> frag : linkFlags) {
+ frag.Value = cmTrimWhitespace(frag.Value);
+ linkFragments.append(
+ this->DumpCommandFragment(this->ToJBT(frag), "flags"));
+ }
}
if (!frameworkPath.empty()) {