summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGhsMultiGenerator.cxx
diff options
context:
space:
mode:
authorFred Baksik <frodak17@gmail.com>2018-07-07 11:27:21 (GMT)
committerFred Baksik <frodak17@gmail.com>2018-07-11 12:44:49 (GMT)
commitbb77dc0cee95b2606ab6715aa9babc89c09d176f (patch)
tree23444417c8f30f91a864efa890d2c534b6aae21a /Source/cmGlobalGhsMultiGenerator.cxx
parentf80692cf600675bae4d12810c8119a62e76aa701 (diff)
downloadCMake-bb77dc0cee95b2606ab6715aa9babc89c09d176f.zip
CMake-bb77dc0cee95b2606ab6715aa9babc89c09d176f.tar.gz
CMake-bb77dc0cee95b2606ab6715aa9babc89c09d176f.tar.bz2
GHS: Set primary target using arch/platform values (or user specified value)
Diffstat (limited to 'Source/cmGlobalGhsMultiGenerator.cxx')
-rw-r--r--Source/cmGlobalGhsMultiGenerator.cxx22
1 files changed, 20 insertions, 2 deletions
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index ddf8147..17fac41 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -335,8 +335,26 @@ void cmGlobalGhsMultiGenerator::WriteMacros()
void cmGlobalGhsMultiGenerator::WriteHighLevelDirectives()
{
- *this->GetBuildFileStream()
- << "primaryTarget=arm_integrity.tgt" << std::endl;
+ /* set primary target */
+ std::string tgt;
+ const char* t =
+ this->GetCMakeInstance()->GetCacheDefinition("GHS_PRIMARY_TARGET");
+ if (t) {
+ tgt = t;
+ this->GetCMakeInstance()->MarkCliAsUsed("GHS_PRIMARY_TARGET");
+ } else {
+ const char* a =
+ this->GetCMakeInstance()->GetCacheDefinition("CMAKE_GENERATOR_PLATFORM");
+ const char* p =
+ this->GetCMakeInstance()->GetCacheDefinition("GHS_TARGET_PLATFORM");
+ tgt = (a ? a : "");
+ tgt += "_";
+ tgt += (p ? p : "");
+ tgt += ".tgt";
+ }
+
+ *this->GetBuildFileStream() << "primaryTarget=" << tgt << std::endl;
+
char const* const customization =
this->GetCMakeInstance()->GetCacheDefinition("GHS_CUSTOMIZATION");
if (NULL != customization && strlen(customization) > 0) {