summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorFred Baksik <fdk17@ftml.net>2021-11-15 18:15:11 (GMT)
committerFred Baksik <fdk17@ftml.net>2021-11-15 18:15:11 (GMT)
commit0427f225395d3fbc5df273596cb7b9d150a369b7 (patch)
tree5879329bb2df7a1219df69a8ee527e494b4f2ec0 /Source
parente006b87cc635f847eebad567159d17db191dc1f0 (diff)
downloadCMake-0427f225395d3fbc5df273596cb7b9d150a369b7.zip
CMake-0427f225395d3fbc5df273596cb7b9d150a369b7.tar.gz
CMake-0427f225395d3fbc5df273596cb7b9d150a369b7.tar.bz2
GHS: Update RTOS selection logic
Selection of an RTOS only needs to be performed if not set by user. Avoid CMake developer warnings for setting GHS_OS_DIR multiple times. Instead only set it once after searching has been performed. Remove all the logic for printing error and status messages about RTOS selection. This was broken and reporting incorrect messages. These messages also breaks CMake tests. NOTE: If RTOS selection fails then the compiler checks will result in a build error. The build error will report that the RTOS "GHS_OS_DIR-NOT-SPECIFIED" does not exist.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalGhsMultiGenerator.cxx30
-rw-r--r--Source/cmGlobalGhsMultiGenerator.h1
2 files changed, 3 insertions, 28 deletions
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 0727f67..e319242 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -133,27 +133,6 @@ bool cmGlobalGhsMultiGenerator::SetGeneratorPlatform(std::string const& p,
cmStateEnums::STRING, true);
}
- /* check if OS location has been updated by platform scripts */
- std::string platform = mf->GetSafeDefinition("GHS_TARGET_PLATFORM");
- std::string osdir = mf->GetSafeDefinition("GHS_OS_DIR");
- if (cmIsOff(osdir) && platform.find("integrity") != std::string::npos) {
- if (!this->CMakeInstance->GetIsInTryCompile()) {
- /* required OS location is not found */
- std::string m = cmStrCat(
- "Green Hills MULTI: GHS_OS_DIR not specified; No OS found in \"",
- mf->GetSafeDefinition("GHS_OS_ROOT"), '"');
- cmSystemTools::Message(m);
- }
- osdir = "GHS_OS_DIR-NOT-SPECIFIED";
- } else if (!this->CMakeInstance->GetIsInTryCompile() &&
- cmIsOff(this->OsDir) && !cmIsOff(osdir)) {
- /* OS location was updated by auto-selection */
- std::string m = cmStrCat(
- "Green Hills MULTI: GHS_OS_DIR not specified; found \"", osdir, '"');
- cmSystemTools::Message(m);
- }
- this->OsDir = osdir;
-
// Determine GHS_BSP_NAME
std::string bspName = mf->GetSafeDefinition("GHS_BSP_NAME");
@@ -180,9 +159,6 @@ void cmGlobalGhsMultiGenerator::EnableLanguage(
mf->AddDefinition("GHSMULTI", "1"); // identifier for user CMake files
- /* store original OS location */
- this->OsDir = mf->GetSafeDefinition("GHS_OS_DIR");
-
this->cmGlobalGenerator::EnableLanguage(l, mf, optional);
}
@@ -340,17 +316,17 @@ void cmGlobalGhsMultiGenerator::WriteTopLevelProject(std::ostream& fout,
// Specify OS DIR if supplied by user
// -- not all platforms require this entry in the project file
- if (!cmIsOff(this->OsDir)) {
+ cmValue osDir = this->GetCMakeInstance()->GetCacheDefinition("GHS_OS_DIR");
+ if (!cmIsOff(osDir)) {
cmValue osDirOption =
this->GetCMakeInstance()->GetCacheDefinition("GHS_OS_DIR_OPTION");
- std::replace(this->OsDir.begin(), this->OsDir.end(), '\\', '/');
fout << " ";
if (cmIsOff(osDirOption)) {
fout << "";
} else {
fout << *osDirOption;
}
- fout << "\"" << this->OsDir << "\"\n";
+ fout << "\"" << osDir << "\"\n";
}
}
diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h
index 935a878..9076e0e 100644
--- a/Source/cmGlobalGhsMultiGenerator.h
+++ b/Source/cmGlobalGhsMultiGenerator.h
@@ -112,7 +112,6 @@ private:
static std::string TrimQuotes(std::string str);
- std::string OsDir;
static const char* DEFAULT_BUILD_PROGRAM;
bool ComputeTargetBuildOrder(cmGeneratorTarget const* tgt,