diff options
author | Fred Baksik <frodak17@gmail.com> | 2018-07-07 11:27:22 (GMT) |
---|---|---|
committer | Fred Baksik <frodak17@gmail.com> | 2018-07-11 12:48:23 (GMT) |
commit | 281c601024e7a82f85ef02ce00a0fc5686c5412d (patch) | |
tree | becdcb3cba305d05cfeac8a4ff790069f040b137 /Source | |
parent | 01c98c6cccc5a4d5c9faaf524da92590492e9976 (diff) | |
download | CMake-281c601024e7a82f85ef02ce00a0fc5686c5412d.zip CMake-281c601024e7a82f85ef02ce00a0fc5686c5412d.tar.gz CMake-281c601024e7a82f85ef02ce00a0fc5686c5412d.tar.bz2 |
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')
-rw-r--r-- | Source/cmGlobalGhsMultiGenerator.cxx | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx index 17fac41..a9742c5 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); } |