Commit 281c6010 authored by Fred Baksik's avatar Fred Baksik
Browse files

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
parent 01c98c6c
...@@ -37,9 +37,12 @@ Default to ``C:/ghs``. Root path for RTOS searches. ...@@ -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 Default to latest platform OS installation at ``GHS_OS_ROOT``. Set this value if
a specific RTOS is to be used. 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: Customizations are available through the following cache variables:
* ``GHS_BSP_NAME``
* ``GHS_CUSTOMIZATION`` * ``GHS_CUSTOMIZATION``
* ``GHS_GPJ_MACROS`` * ``GHS_GPJ_MACROS``
......
...@@ -37,7 +37,8 @@ if ( NOT GHS_OS_DIR ) ...@@ -37,7 +37,8 @@ if ( NOT GHS_OS_DIR )
endif () endif ()
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") set(GHS_CUSTOMIZATION "" CACHE FILEPATH "optional GHS customization")
mark_as_advanced(GHS_CUSTOMIZATION) mark_as_advanced(GHS_CUSTOMIZATION)
set(GHS_GPJ_MACROS "" CACHE STRING "optional GHS macros generated in the .gpjs for legacy reasons") set(GHS_GPJ_MACROS "" CACHE STRING "optional GHS macros generated in the .gpjs for legacy reasons")
......
...@@ -236,25 +236,28 @@ void cmGlobalGhsMultiGenerator::OpenBuildFileStream() ...@@ -236,25 +236,28 @@ void cmGlobalGhsMultiGenerator::OpenBuildFileStream()
this->OSDirRelative = true; this->OSDirRelative = true;
} }
char const* bspName = std::string bspName;
char const* bspCache =
this->GetCMakeInstance()->GetCacheDefinition("GHS_BSP_NAME"); this->GetCMakeInstance()->GetCacheDefinition("GHS_BSP_NAME");
if (NULL == bspName) { if (bspCache) {
bspName = ""; bspName = bspCache;
cmSystemTools::Error("GHS_BSP_NAME cache variable must be set");
} else {
this->GetCMakeInstance()->MarkCliAsUsed("GHS_BSP_NAME"); this->GetCMakeInstance()->MarkCliAsUsed("GHS_BSP_NAME");
} }
std::string fBspName(this->trimQuotes(bspName)); if (bspName.empty() || bspName.compare("IGNORE") == 0) {
std::replace(fBspName.begin(), fBspName.end(), '\\', '/'); const char* a =
this->GetCMakeInstance()->GetCacheDefinition("CMAKE_GENERATOR_PLATFORM");
bspName = "sim";
bspName += (a ? a : "");
}
this->WriteMacros(); this->WriteMacros();
this->WriteHighLevelDirectives(); this->WriteHighLevelDirectives();
GhsMultiGpj::WriteGpjTag(GhsMultiGpj::PROJECT, this->GetBuildFileStream()); GhsMultiGpj::WriteGpjTag(GhsMultiGpj::PROJECT, this->GetBuildFileStream());
this->WriteDisclaimer(this->GetBuildFileStream()); this->WriteDisclaimer(this->GetBuildFileStream());
*this->GetBuildFileStream() << "# Top Level Project File" << std::endl; *this->GetBuildFileStream() << "# Top Level Project File" << std::endl;
if (!fBspName.empty()) { *this->GetBuildFileStream() << " -bsp " << bspName << std::endl;
*this->GetBuildFileStream() << " -bsp " << fBspName << std::endl;
}
this->WriteCompilerOptions(fOSDir); this->WriteCompilerOptions(fOSDir);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment