diff options
-rw-r--r-- | Source/cmLocalGenerator.cxx | 11 | ||||
-rw-r--r-- | Source/cmLocalGenerator.h | 3 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 4 | ||||
-rw-r--r-- | Source/cmMakefileExecutableTargetGenerator.cxx | 13 | ||||
-rw-r--r-- | Source/cmMakefileLibraryTargetGenerator.cxx | 13 | ||||
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 8 | ||||
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 4 |
8 files changed, 29 insertions, 31 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 288172e..8bd3017 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -823,16 +823,13 @@ cmStateSnapshot cmLocalGenerator::GetStateSnapshot() const return this->Makefile->GetStateSnapshot(); } -const char* cmLocalGenerator::GetRuleLauncher(cmGeneratorTarget* target, - const std::string& prop) +cmProp cmLocalGenerator::GetRuleLauncher(cmGeneratorTarget* target, + const std::string& prop) { - cmProp p; if (target) { - p = target->GetProperty(prop); - } else { - p = this->Makefile->GetProperty(prop); + return target->GetProperty(prop); } - return p ? p->c_str() : nullptr; + return this->Makefile->GetProperty(prop); } std::string cmLocalGenerator::ConvertToIncludeReference( diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index b8bd3bc..30371c5 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -519,8 +519,7 @@ public: void CreateEvaluationFileOutputs(const std::string& config); void ProcessEvaluationFiles(std::vector<std::string>& generatedFiles); - const char* GetRuleLauncher(cmGeneratorTarget* target, - const std::string& prop); + cmProp GetRuleLauncher(cmGeneratorTarget* target, const std::string& prop); protected: //! put all the libraries for a target on into the given stream diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index c877cf8..dd27084 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -960,7 +960,7 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand( std::string launcher; // Short-circuit if there is no launcher. - const char* val = this->GetRuleLauncher(target, "RULE_LAUNCH_CUSTOM"); + cmProp val = this->GetRuleLauncher(target, "RULE_LAUNCH_CUSTOM"); if (cmNonempty(val)) { // Expand rule variables referenced in the given launcher command. cmRulePlaceholderExpander::RuleVariables vars; @@ -980,7 +980,7 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand( } vars.Output = output.c_str(); - launcher = val; + launcher = *val; rulePlaceholderExpander->ExpandRuleVariables(this, launcher, vars); if (!launcher.empty()) { launcher += " "; diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 871878c..1750e37 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -21,6 +21,7 @@ #include "cmMakefile.h" #include "cmOSXBundleGenerator.h" #include "cmOutputConverter.h" +#include "cmProperty.h" #include "cmRulePlaceholderExpander.h" #include "cmState.h" #include "cmStateDirectory.h" @@ -232,10 +233,10 @@ void cmMakefileExecutableTargetGenerator::WriteNvidiaDeviceExecutableRule( std::string launcher; - const char* val = this->LocalGenerator->GetRuleLauncher( - this->GeneratorTarget, "RULE_LAUNCH_LINK"); + cmProp val = this->LocalGenerator->GetRuleLauncher(this->GeneratorTarget, + "RULE_LAUNCH_LINK"); if (cmNonempty(val)) { - launcher = cmStrCat(val, ' '); + launcher = cmStrCat(*val, ' '); } std::unique_ptr<cmRulePlaceholderExpander> rulePlaceholderExpander( @@ -591,10 +592,10 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) std::string launcher; - const char* val = this->LocalGenerator->GetRuleLauncher( - this->GeneratorTarget, "RULE_LAUNCH_LINK"); + cmProp val = this->LocalGenerator->GetRuleLauncher(this->GeneratorTarget, + "RULE_LAUNCH_LINK"); if (cmNonempty(val)) { - launcher = cmStrCat(val, ' '); + launcher = cmStrCat(*val, ' '); } std::unique_ptr<cmRulePlaceholderExpander> rulePlaceholderExpander( diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index b32ea6a..ce64e2c 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -21,6 +21,7 @@ #include "cmMakefile.h" #include "cmOSXBundleGenerator.h" #include "cmOutputConverter.h" +#include "cmProperty.h" #include "cmRulePlaceholderExpander.h" #include "cmState.h" #include "cmStateDirectory.h" @@ -366,10 +367,10 @@ void cmMakefileLibraryTargetGenerator::WriteNvidiaDeviceLibraryRules( vars.TargetCompilePDB = targetOutPathCompilePDB.c_str(); std::string launcher; - const char* val = this->LocalGenerator->GetRuleLauncher( - this->GeneratorTarget, "RULE_LAUNCH_LINK"); + cmProp val = this->LocalGenerator->GetRuleLauncher(this->GeneratorTarget, + "RULE_LAUNCH_LINK"); if (cmNonempty(val)) { - launcher = cmStrCat(val, ' '); + launcher = cmStrCat(*val, ' '); } std::unique_ptr<cmRulePlaceholderExpander> rulePlaceholderExpander( @@ -816,10 +817,10 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( vars.LanguageCompileFlags = langFlags.c_str(); std::string launcher; - const char* val = this->LocalGenerator->GetRuleLauncher( - this->GeneratorTarget, "RULE_LAUNCH_LINK"); + cmProp val = this->LocalGenerator->GetRuleLauncher(this->GeneratorTarget, + "RULE_LAUNCH_LINK"); if (cmNonempty(val)) { - launcher = cmStrCat(val, ' '); + launcher = cmStrCat(*val, ' '); } std::unique_ptr<cmRulePlaceholderExpander> rulePlaceholderExpander( diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 5f97d86..b160064 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -943,10 +943,10 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( std::string launcher; { - const char* val = this->LocalGenerator->GetRuleLauncher( + cmProp val = this->LocalGenerator->GetRuleLauncher( this->GeneratorTarget, "RULE_LAUNCH_COMPILE"); if (cmNonempty(val)) { - launcher = cmStrCat(val, ' '); + launcher = cmStrCat(*val, ' '); } } diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index ccb959b..a5b9466 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -266,10 +266,10 @@ void cmNinjaNormalTargetGenerator::WriteNvidiaDeviceLinkRule( vars.LanguageCompileFlags = "$LANGUAGE_COMPILE_FLAGS"; std::string launcher; - const char* val = this->GetLocalGenerator()->GetRuleLauncher( + cmProp val = this->GetLocalGenerator()->GetRuleLauncher( this->GetGeneratorTarget(), "RULE_LAUNCH_LINK"); if (cmNonempty(val)) { - launcher = cmStrCat(val, ' '); + launcher = cmStrCat(*val, ' '); } std::unique_ptr<cmRulePlaceholderExpander> rulePlaceholderExpander( @@ -452,10 +452,10 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile, } std::string launcher; - const char* val = this->GetLocalGenerator()->GetRuleLauncher( + cmProp val = this->GetLocalGenerator()->GetRuleLauncher( this->GetGeneratorTarget(), "RULE_LAUNCH_LINK"); if (cmNonempty(val)) { - launcher = cmStrCat(val, ' '); + launcher = cmStrCat(*val, ' '); } std::unique_ptr<cmRulePlaceholderExpander> rulePlaceholderExpander( diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 04d84a0..0566949 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -664,10 +664,10 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang, cmLocalGenerator::SHELL); std::string launcher; - const char* val = this->GetLocalGenerator()->GetRuleLauncher( + cmProp val = this->GetLocalGenerator()->GetRuleLauncher( this->GetGeneratorTarget(), "RULE_LAUNCH_COMPILE"); if (cmNonempty(val)) { - launcher = cmStrCat(val, ' '); + launcher = cmStrCat(*val, ' '); } std::string const cmakeCmd = |