summaryrefslogtreecommitdiff
path: root/Source/cmGlobalGhsMultiGenerator.cxx
diff options
context:
space:
mode:
authorFred Baksik <frodak17@gmail.com>2018-07-07 07:27:22 -0400
committerFred Baksik <frodak17@gmail.com>2018-07-11 08:48:23 -0400
commit281c601024e7a82f85ef02ce00a0fc5686c5412d (patch)
treebecdcb3cba305d05cfeac8a4ff790069f040b137 /Source/cmGlobalGhsMultiGenerator.cxx
parent01c98c6cccc5a4d5c9faaf524da92590492e9976 (diff)
downloadcmake-281c601024e7a82f85ef02ce00a0fc5686c5412d.tar.gz
GHS: Update default BSP name
-- Use default value of sim<arch> if not user defined -- Also no reason to trim quotes or changes slashes; it is just a name not a path
Diffstat (limited to 'Source/cmGlobalGhsMultiGenerator.cxx')
-rw-r--r--Source/cmGlobalGhsMultiGenerator.cxx23
1 files changed, 13 insertions, 10 deletions
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 17fac41615..a9742c5317 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -236,25 +236,28 @@ void cmGlobalGhsMultiGenerator::OpenBuildFileStream()
this->OSDirRelative = true;
}
- char const* bspName =
+ std::string bspName;
+ char const* bspCache =
this->GetCMakeInstance()->GetCacheDefinition("GHS_BSP_NAME");
- if (NULL == bspName) {
- bspName = "";
- cmSystemTools::Error("GHS_BSP_NAME cache variable must be set");
- } else {
+ if (bspCache) {
+ bspName = bspCache;
this->GetCMakeInstance()->MarkCliAsUsed("GHS_BSP_NAME");
}
- std::string fBspName(this->trimQuotes(bspName));
- std::replace(fBspName.begin(), fBspName.end(), '\\', '/');
+ if (bspName.empty() || bspName.compare("IGNORE") == 0) {
+ const char* a =
+ this->GetCMakeInstance()->GetCacheDefinition("CMAKE_GENERATOR_PLATFORM");
+ bspName = "sim";
+ bspName += (a ? a : "");
+ }
+
this->WriteMacros();
this->WriteHighLevelDirectives();
GhsMultiGpj::WriteGpjTag(GhsMultiGpj::PROJECT, this->GetBuildFileStream());
this->WriteDisclaimer(this->GetBuildFileStream());
*this->GetBuildFileStream() << "# Top Level Project File" << std::endl;
- if (!fBspName.empty()) {
- *this->GetBuildFileStream() << " -bsp " << fBspName << std::endl;
- }
+ *this->GetBuildFileStream() << " -bsp " << bspName << std::endl;
+
this->WriteCompilerOptions(fOSDir);
}