summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGhsMultiGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGlobalGhsMultiGenerator.cxx')
-rw-r--r--Source/cmGlobalGhsMultiGenerator.cxx25
1 files changed, 13 insertions, 12 deletions
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index d36adfb..cbaf0ab 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -100,13 +100,13 @@ bool cmGlobalGhsMultiGenerator::SetGeneratorToolset(std::string const& ts,
/* set the build tool to use */
std::string gbuild(tsp + ((tsp.back() == '/') ? "" : "/") +
DEFAULT_BUILD_PROGRAM);
- const char* prevTool = mf->GetDefinition("CMAKE_MAKE_PROGRAM");
+ cmProp prevTool = mf->GetDefinition("CMAKE_MAKE_PROGRAM");
/* check if the toolset changed from last generate */
- if (prevTool != nullptr && (gbuild != prevTool)) {
+ if (prevTool && (gbuild != *prevTool)) {
std::string message =
cmStrCat("toolset build tool: ", gbuild,
- "\nDoes not match the previously used build tool: ", prevTool,
+ "\nDoes not match the previously used build tool: ", *prevTool,
"\nEither remove the CMakeCache.txt file and CMakeFiles "
"directory or choose a different binary directory.");
cmSystemTools::Error(message);
@@ -187,7 +187,8 @@ void cmGlobalGhsMultiGenerator::EnableLanguage(
mf->AddDefinition("GHSMULTI", "1"); // identifier for user CMake files
- const char* tgtPlatform = mf->GetDefinition("GHS_TARGET_PLATFORM");
+ const char* tgtPlatform =
+ cmToCStrSafe(mf->GetDefinition("GHS_TARGET_PLATFORM"));
if (!tgtPlatform) {
cmSystemTools::Message("Green Hills MULTI: GHS_TARGET_PLATFORM not "
"specified; defaulting to \"integrity\"");
@@ -216,12 +217,13 @@ bool cmGlobalGhsMultiGenerator::FindMakeProgram(cmMakefile* /*mf*/)
void cmGlobalGhsMultiGenerator::GetToolset(cmMakefile* mf, std::string& tsd,
const std::string& ts)
{
- const char* ghsRoot = mf->GetDefinition("GHS_TOOLSET_ROOT");
+ cmProp ghsRoot = mf->GetDefinition("GHS_TOOLSET_ROOT");
- if (!ghsRoot || ghsRoot[0] == '\0') {
- ghsRoot = DEFAULT_TOOLSET_ROOT;
+ if (cmNonempty(ghsRoot)) {
+ tsd = *ghsRoot;
+ } else {
+ tsd = DEFAULT_TOOLSET_ROOT;
}
- tsd = ghsRoot;
if (ts.empty()) {
std::vector<std::string> output;
@@ -467,11 +469,10 @@ void cmGlobalGhsMultiGenerator::WriteAllTarget(
this->ProjectTargets.push_back(t);
}
for (cmGeneratorTarget const* t : sortedProjectTargets) {
- if (t->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!t->IsInBuildSystem()) {
continue;
}
- cmProp p = t->GetProperty("EXCLUDE_FROM_ALL");
- if (!(p && cmIsOn(*p))) {
+ if (!IsExcluded(t->GetLocalGenerator(), t)) {
defaultTargets.push_back(t);
}
}
@@ -635,7 +636,7 @@ void cmGlobalGhsMultiGenerator::WriteHighLevelDirectives(
std::string tgt;
const char* t =
this->GetCMakeInstance()->GetCacheDefinition("GHS_PRIMARY_TARGET");
- if (t && *t != '\0') {
+ if (cmNonempty(t)) {
tgt = t;
this->GetCMakeInstance()->MarkCliAsUsed("GHS_PRIMARY_TARGET");
} else {