diff options
author | Brad King <brad.king@kitware.com> | 2009-02-02 18:28:17 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-02-02 18:28:17 (GMT) |
commit | 496c203a0bccb093fcab46c403ba876662ab6717 (patch) | |
tree | 0cd0761b08a994950d70bf5080c9ca9f99206b95 /Source/cmMakefileTargetGenerator.cxx | |
parent | ac9b7ec1558e1370f578c67b1296fbe778a92b81 (diff) | |
download | CMake-496c203a0bccb093fcab46c403ba876662ab6717.zip CMake-496c203a0bccb093fcab46c403ba876662ab6717.tar.gz CMake-496c203a0bccb093fcab46c403ba876662ab6717.tar.bz2 |
BUG: Do not expand rule variables in info rules
Previously the makefile generator would expand rule variables even on
its progress and echo commands for object compilation rules (but not for
link rules). This fixes the implementation to only expand rule
variables on user-specified rules.
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 69 |
1 files changed, 36 insertions, 33 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index c2cad66..14f1a3d 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -601,23 +601,6 @@ cmMakefileTargetGenerator this->LocalGenerator->AppendEcho(commands, buildEcho.c_str(), cmLocalUnixMakefileGenerator3::EchoBuild); - // Construct the compile rules. - std::string compileRuleVar = "CMAKE_"; - compileRuleVar += lang; - compileRuleVar += "_COMPILE_OBJECT"; - std::string compileRule = - this->Makefile->GetRequiredDefinition(compileRuleVar.c_str()); - std::vector<std::string> compileCommands; - cmSystemTools::ExpandListArgument(compileRule, compileCommands); - - // Change the command working directory to the local build tree. - this->LocalGenerator->CreateCDCommand - (compileCommands, - this->Makefile->GetStartOutputDirectory(), - cmLocalGenerator::HOME_OUTPUT); - commands.insert(commands.end(), - compileCommands.begin(), compileCommands.end()); - std::string targetOutPathPDB; { std::string targetFullPathPDB; @@ -652,13 +635,31 @@ cmMakefileTargetGenerator vars.Flags = flags.c_str(); vars.Defines = defines.c_str(); + // Construct the compile rules. + { + std::string compileRuleVar = "CMAKE_"; + compileRuleVar += lang; + compileRuleVar += "_COMPILE_OBJECT"; + std::string compileRule = + this->Makefile->GetRequiredDefinition(compileRuleVar.c_str()); + std::vector<std::string> compileCommands; + cmSystemTools::ExpandListArgument(compileRule, compileCommands); + // Expand placeholders in the commands. - for(std::vector<std::string>::iterator i = commands.begin(); - i != commands.end(); ++i) + for(std::vector<std::string>::iterator i = compileCommands.begin(); + i != compileCommands.end(); ++i) { this->LocalGenerator->ExpandRuleVariables(*i, vars); } + // Change the command working directory to the local build tree. + this->LocalGenerator->CreateCDCommand + (compileCommands, + this->Makefile->GetStartOutputDirectory(), + cmLocalGenerator::HOME_OUTPUT); + commands.insert(commands.end(), + compileCommands.begin(), compileCommands.end()); + } // Write the rule. this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0, @@ -722,6 +723,14 @@ cmMakefileTargetGenerator { std::vector<std::string> preprocessCommands; cmSystemTools::ExpandListArgument(preprocessRule, preprocessCommands); + + // Expand placeholders in the commands. + for(std::vector<std::string>::iterator i = preprocessCommands.begin(); + i != preprocessCommands.end(); ++i) + { + this->LocalGenerator->ExpandRuleVariables(*i, vars); + } + this->LocalGenerator->CreateCDCommand (preprocessCommands, this->Makefile->GetStartOutputDirectory(), @@ -735,13 +744,6 @@ cmMakefileTargetGenerator cmLocalGenerator::NONE, cmLocalGenerator::SHELL).c_str(); vars.PreprocessedSource = shellObjI.c_str(); - - // Expand placeholders in the commands. - for(std::vector<std::string>::iterator i = commands.begin(); - i != commands.end(); ++i) - { - this->LocalGenerator->ExpandRuleVariables(*i, vars); - } } else { @@ -778,6 +780,14 @@ cmMakefileTargetGenerator { std::vector<std::string> assemblyCommands; cmSystemTools::ExpandListArgument(assemblyRule, assemblyCommands); + + // Expand placeholders in the commands. + for(std::vector<std::string>::iterator i = assemblyCommands.begin(); + i != assemblyCommands.end(); ++i) + { + this->LocalGenerator->ExpandRuleVariables(*i, vars); + } + this->LocalGenerator->CreateCDCommand (assemblyCommands, this->Makefile->GetStartOutputDirectory(), @@ -791,13 +801,6 @@ cmMakefileTargetGenerator cmLocalGenerator::NONE, cmLocalGenerator::SHELL).c_str(); vars.AssemblySource = shellObjS.c_str(); - - // Expand placeholders in the commands. - for(std::vector<std::string>::iterator i = commands.begin(); - i != commands.end(); ++i) - { - this->LocalGenerator->ExpandRuleVariables(*i, vars); - } } else { |