summaryrefslogtreecommitdiffstats
path: root/Source/cmCPluginAPI.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmCPluginAPI.cxx')
-rw-r--r--Source/cmCPluginAPI.cxx18
1 files changed, 8 insertions, 10 deletions
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index 255a8e6..f0c1845 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -65,8 +65,10 @@ unsigned int CCONV cmGetMinorVersion(void*)
void CCONV cmAddDefinition(void* arg, const char* name, const char* value)
{
- cmMakefile* mf = static_cast<cmMakefile*>(arg);
- mf->AddDefinition(name, value);
+ if (value) {
+ cmMakefile* mf = static_cast<cmMakefile*>(arg);
+ mf->AddDefinition(name, value);
+ }
}
/* Add a definition to this makefile and the global cmake cache. */
@@ -421,7 +423,7 @@ int CCONV cmExecuteCommand(void* arg, const char* name, int numArgs,
// Assume all arguments are quoted.
lff.Arguments.emplace_back(args[i], cmListFileArgument::Quoted, 0);
}
- cmExecutionStatus status;
+ cmExecutionStatus status(*mf);
return mf->ExecuteCommand(lff, status);
}
@@ -606,7 +608,7 @@ int CCONV cmSourceFileGetPropertyAsBool(void* arg, const char* prop)
if (cmSourceFile* rsf = sf->RealSourceFile) {
return rsf->GetPropertyAsBool(prop) ? 1 : 0;
}
- return cmSystemTools::IsOn(cmSourceFileGetProperty(arg, prop)) ? 1 : 0;
+ return cmIsOn(cmSourceFileGetProperty(arg, prop)) ? 1 : 0;
}
void CCONV cmSourceFileSetProperty(void* arg, const char* prop,
@@ -688,9 +690,7 @@ void CCONV cmSourceFileSetName(void* arg, const char* name, const char* dir,
// Next, try the various source extensions
for (std::string const& ext : sourceExts) {
- hname = pathname;
- hname += ".";
- hname += ext;
+ hname = cmStrCat(pathname, '.', ext);
if (cmSystemTools::FileExists(hname)) {
sf->SourceExtension = ext;
sf->FullPath = hname;
@@ -700,9 +700,7 @@ void CCONV cmSourceFileSetName(void* arg, const char* name, const char* dir,
// Finally, try the various header extensions
for (std::string const& ext : headerExts) {
- hname = pathname;
- hname += ".";
- hname += ext;
+ hname = cmStrCat(pathname, '.', ext);
if (cmSystemTools::FileExists(hname)) {
sf->SourceExtension = ext;
sf->FullPath = hname;