diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index cce10ce77..91e37c4a1 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -448,84 +448,6 @@ cmState::Snapshot cmLocalGenerator::GetStateSnapshot() const return this->StateSnapshot; } -void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname, - const std::string& lang, - cmSourceFile& source, - cmGeneratorTarget& target) -{ - std::string objectDir = cmSystemTools::GetFilenamePath(std::string(ofname)); - objectDir = this->Convert(objectDir,START_OUTPUT,SHELL); - std::string objectFile = this->Convert(ofname,START_OUTPUT,SHELL); - std::string sourceFile = - this->ConvertToOutputFormat(source.GetFullPath(), SHELL); - std::string varString = "CMAKE_"; - varString += lang; - varString += "_COMPILE_OBJECT"; - std::vector rules; - rules.push_back(this->Makefile->GetRequiredDefinition(varString)); - varString = "CMAKE_"; - varString += lang; - varString += "_FLAGS"; - std::string flags; - flags += this->Makefile->GetSafeDefinition(varString); - flags += " "; - { - std::vector includes; - this->GetIncludeDirectories(includes, &target, lang); - flags += this->GetIncludeFlags(includes, &target, lang); - } - flags += this->Makefile->GetDefineFlags(); - - // Construct the command lines. - cmCustomCommandLines commandLines; - std::vector commands; - cmSystemTools::ExpandList(rules, commands); - cmLocalGenerator::RuleVariables vars; - vars.Language = lang.c_str(); - vars.Source = sourceFile.c_str(); - vars.Object = objectFile.c_str(); - vars.ObjectDir = objectDir.c_str(); - vars.Flags = flags.c_str(); - for(std::vector::iterator i = commands.begin(); - i != commands.end(); ++i) - { - // Expand the full command line string. - this->ExpandRuleVariables(*i, vars); - - // Parse the string to get the custom command line. - cmCustomCommandLine commandLine; - std::vector cmd = cmSystemTools::ParseArguments(i->c_str()); - commandLine.insert(commandLine.end(), cmd.begin(), cmd.end()); - - // Store this command line. - commandLines.push_back(commandLine); - } - - // Check for extra object-file dependencies. - std::vector depends; - const char* additionalDeps = source.GetProperty("OBJECT_DEPENDS"); - if(additionalDeps) - { - cmSystemTools::ExpandListArgument(additionalDeps, depends); - } - - // Generate a meaningful comment for the command. - std::string comment = "Building "; - comment += lang; - comment += " object "; - comment += this->Convert(ofname, START_OUTPUT); - - // Add the custom command to build the object file. - this->Makefile->AddCustomCommandToOutput( - ofname, - depends, - source.GetFullPath(), - commandLines, - comment.c_str(), - this->StateSnapshot.GetDirectory().GetCurrentBinary() - ); -} - // List of variables that are replaced when // rules are expanced. These variables are // replaced in the form with GetSafeDefinition(var). diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 429d5fcf3..297157429 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -328,12 +328,6 @@ protected: void InsertRuleLauncher(std::string& s, cmTarget* target, const std::string& prop); - ///! add a custom command to build a .o file that is part of a target - void AddCustomCommandToCreateObject(const char* ofname, - const std::string& lang, - cmSourceFile& source, - cmGeneratorTarget& target); - // Handle old-style install rules stored in the targets. void GenerateTargetInstallRules( std::ostream& os, const std::string& config,