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

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.
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``
......
......@@ -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")
......
......@@ -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);
}
......
Markdown is supported
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