summaryrefslogtreecommitdiffstats
path: root/Source/cmGhsMultiTargetGenerator.cxx
diff options
context:
space:
mode:
authorGeoff Viola <geoffrey.viola@asirobots.com>2016-03-27 03:28:31 (GMT)
committerBrad King <brad.king@kitware.com>2016-03-28 15:46:46 (GMT)
commit36ad8dd440069b126ca28dccf57e8c65188c693b (patch)
tree155c74284c62f6ed1d4c234e351016bfdd742be7 /Source/cmGhsMultiTargetGenerator.cxx
parent230d50ed1a1bbeac3b840ecc2d45c1b8710c8be4 (diff)
downloadCMake-36ad8dd440069b126ca28dccf57e8c65188c693b.zip
CMake-36ad8dd440069b126ca28dccf57e8c65188c693b.tar.gz
CMake-36ad8dd440069b126ca28dccf57e8c65188c693b.tar.bz2
GHS: Implement link flags and dirs for non-target groups (#16029)
Diffstat (limited to 'Source/cmGhsMultiTargetGenerator.cxx')
-rw-r--r--Source/cmGhsMultiTargetGenerator.cxx34
1 files changed, 32 insertions, 2 deletions
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index c5813ba..1f17f8f 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -149,7 +149,7 @@ void cmGhsMultiTargetGenerator::Generate()
this->WriteIncludes(config, language);
if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE)
{
- this->WriteTargetLinkLibraries();
+ this->WriteTargetLinkLibraries(config, language);
}
this->WriteCustomCommands();
@@ -365,7 +365,8 @@ void cmGhsMultiTargetGenerator::WriteIncludes(const std::string &config,
}
}
-void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries()
+void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries(
+ std::string const& config, std::string const& language)
{
// library directories
cmTargetDependSet tds =
@@ -393,6 +394,35 @@ void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries()
*this->GetFolderBuildStreams() << " -l\"" << libName << "\""
<< std::endl;
}
+
+ if (!this->TargetGroup)
+ {
+ std::string linkLibraries;
+ std::string flags;
+ std::string linkFlags;
+ std::string frameworkPath;
+ std::string linkPath;
+ std::string createRule =
+ this->GeneratorTarget->GetCreateRuleVariable(language, config);
+ bool useWatcomQuote =
+ this->Makefile->IsOn(createRule + "_USE_WATCOM_QUOTE");
+ this->LocalGenerator->GetTargetFlags(
+ linkLibraries, flags, linkFlags,
+ frameworkPath, linkPath,
+ this->GeneratorTarget, useWatcomQuote);
+ linkFlags = cmSystemTools::TrimWhitespace(linkFlags);
+
+ if (!linkPath.empty())
+ {
+ linkPath = " " + linkPath.substr(0U, linkPath.size() - 1U);
+ *this->GetFolderBuildStreams() << linkPath;
+ }
+
+ if (!linkFlags.empty())
+ {
+ *this->GetFolderBuildStreams() << " " << linkFlags << std::endl;
+ }
+ }
}
void cmGhsMultiTargetGenerator::WriteCustomCommands()