summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Baksik <frodak17@gmail.com>2018-07-07 11:27:22 (GMT)
committerFred Baksik <frodak17@gmail.com>2018-07-11 12:48:23 (GMT)
commit281c601024e7a82f85ef02ce00a0fc5686c5412d (patch)
treebecdcb3cba305d05cfeac8a4ff790069f040b137
parent01c98c6cccc5a4d5c9faaf524da92590492e9976 (diff)
downloadCMake-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
-rw-r--r--Help/generator/Green Hills MULTI.rst5
-rw-r--r--Modules/Platform/GHS-MULTI-Initialize.cmake3
-rw-r--r--Source/cmGlobalGhsMultiGenerator.cxx23
3 files changed, 19 insertions, 12 deletions
diff --git a/Help/generator/Green Hills MULTI.rst b/Help/generator/Green Hills MULTI.rst
index f148b4f..1b4960d 100644
--- a/Help/generator/Green Hills MULTI.rst
+++ b/Help/generator/Green Hills MULTI.rst
@@ -37,9 +37,12 @@ Default to ``C:/ghs``. Root path for RTOS searches.
Default to latest platform OS installation at ``GHS_OS_ROOT``. Set this value if
a specific RTOS is to be used.
+* ``GHS_BSP_NAME``
+
+Defaults to ``sim<arch>`` if not set by user.
+
Customizations are available through the following cache variables:
-* ``GHS_BSP_NAME``
* ``GHS_CUSTOMIZATION``
* ``GHS_GPJ_MACROS``
diff --git a/Modules/Platform/GHS-MULTI-Initialize.cmake b/Modules/Platform/GHS-MULTI-Initialize.cmake
index 62a7e9f..9b384df 100644
--- a/Modules/Platform/GHS-MULTI-Initialize.cmake
+++ b/Modules/Platform/GHS-MULTI-Initialize.cmake
@@ -37,7 +37,8 @@ if ( NOT GHS_OS_DIR )
endif ()
endif ()
-set(GHS_BSP_NAME "simarm" CACHE STRING "BSP name")
+set(GHS_BSP_NAME "IGNORE" CACHE STRING "BSP name")
+
set(GHS_CUSTOMIZATION "" CACHE FILEPATH "optional GHS customization")
mark_as_advanced(GHS_CUSTOMIZATION)
set(GHS_GPJ_MACROS "" CACHE STRING "optional GHS macros generated in the .gpjs for legacy reasons")
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);
}