diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmCPluginAPI.cxx | 4 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.cxx | 10 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.cxx | 5 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 15 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 18 | ||||
-rw-r--r-- | Source/cmMakefile.h | 7 |
6 files changed, 21 insertions, 38 deletions
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index 29d2495..78a232e 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -220,8 +220,10 @@ void CCONV cmAddUtilityCommand(void* arg, const char* utilityName, } // Pass the call to the makefile instance. + std::vector<std::string> no_byproducts; mf->AddUtilityCommand(utilityName, cmCommandOrigin::Project, - (all ? false : true), nullptr, depends2, commandLines); + (all ? false : true), nullptr, no_byproducts, depends2, + commandLines); } void CCONV cmAddCustomCommand(void* arg, const char* source, const char* command, int numArgs, diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 808bebd..8e6125b 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -96,17 +96,18 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget() return false; } - const char* no_working_directory = nullptr; - std::vector<std::string> no_depends; std::vector<cmLocalGenerator*> const& generators = this->LocalGenerators; cmLocalVisualStudio7Generator* lg = static_cast<cmLocalVisualStudio7Generator*>(generators[0]); cmMakefile* mf = lg->GetMakefile(); - cmCustomCommandLines noCommandLines; + const char* no_working_directory = nullptr; + std::vector<std::string> no_byproducts; + std::vector<std::string> no_depends; + cmCustomCommandLines no_commands; cmTarget* tgt = mf->AddUtilityCommand( CMAKE_CHECK_BUILD_SYSTEM_TARGET, cmCommandOrigin::Generator, false, - no_working_directory, no_depends, noCommandLines); + no_working_directory, no_byproducts, no_depends, no_commands); cmGeneratorTarget* gt = new cmGeneratorTarget(tgt, lg); lg->AddGeneratorTarget(gt); @@ -182,7 +183,6 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget() // file as the main dependency because it would get // overwritten by the CreateVCProjBuildRule. // (this could be avoided with per-target source files) - std::vector<std::string> no_byproducts; std::string no_main_dependency; cmImplicitDependsList no_implicit_depends; if (cmSourceFile* file = mf->AddCustomCommandToOutput( diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 82219bd..0bc08a5 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -183,7 +183,8 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets() { // Add a special target that depends on ALL projects for easy build // of one configuration only. - const char* no_working_dir = 0; + const char* no_working_dir = nullptr; + std::vector<std::string> no_byproducts; std::vector<std::string> no_depends; cmCustomCommandLines no_commands; for (auto const& it : this->ProjectMap) { @@ -194,7 +195,7 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets() // considered always out of date. cmTarget* allBuild = gen[0]->GetMakefile()->AddUtilityCommand( "ALL_BUILD", cmCommandOrigin::Generator, true, no_working_dir, - no_depends, no_commands, false, "Build all projects"); + no_byproducts, no_depends, no_commands, false, "Build all projects"); cmGeneratorTarget* gt = new cmGeneratorTarget(allBuild, gen[0]); gen[0]->AddGeneratorTarget(gt); diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index e4dff78..4202175 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -497,12 +497,15 @@ void cmGlobalXCodeGenerator::AddExtraTargets( { cmMakefile* mf = root->GetMakefile(); - // Add ALL_BUILD const char* no_working_directory = nullptr; + std::vector<std::string> no_byproducts; std::vector<std::string> no_depends; + + // Add ALL_BUILD cmTarget* allbuild = mf->AddUtilityCommand( "ALL_BUILD", cmCommandOrigin::Generator, true, no_working_directory, - no_depends, cmMakeSingleCommandLine({ "echo", "Build all projects" })); + no_byproducts, no_depends, + cmMakeSingleCommandLine({ "echo", "Build all projects" })); cmGeneratorTarget* allBuildGt = new cmGeneratorTarget(allbuild, root); root->AddGeneratorTarget(allBuildGt); @@ -526,7 +529,7 @@ void cmGlobalXCodeGenerator::AddExtraTargets( cmSystemTools::ReplaceString(file, "\\ ", " "); cmTarget* check = mf->AddUtilityCommand( CMAKE_CHECK_BUILD_SYSTEM_TARGET, cmCommandOrigin::Generator, true, - no_working_directory, no_depends, + no_working_directory, no_byproducts, no_depends, cmMakeSingleCommandLine({ "make", "-f", file })); cmGeneratorTarget* checkGt = new cmGeneratorTarget(check, root); @@ -541,9 +544,8 @@ void cmGlobalXCodeGenerator::AddExtraTargets( continue; } - std::string targetName = target->GetName(); - - if (regenerate && (targetName != CMAKE_CHECK_BUILD_SYSTEM_TARGET)) { + if (regenerate && + (target->GetName() != CMAKE_CHECK_BUILD_SYSTEM_TARGET)) { target->Target->AddUtility(CMAKE_CHECK_BUILD_SYSTEM_TARGET); } @@ -554,7 +556,6 @@ void cmGlobalXCodeGenerator::AddExtraTargets( if (target->GetType() == cmStateEnums::OBJECT_LIBRARY) { commandLines.front().back() = // fill placeholder this->PostBuildMakeTarget(target->GetName(), "$(CONFIGURATION)"); - std::vector<std::string> no_byproducts; gen->GetMakefile()->AddCustomCommandToTarget( target->GetName(), no_byproducts, no_depends, commandLines, cmCustomCommandType::POST_BUILD, "Depend check for xcode", diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 2e1c821..a528fc6 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1213,20 +1213,6 @@ cmUtilityOutput cmMakefile::GetUtilityOutput(cmTarget* target) cmTarget* cmMakefile::AddUtilityCommand( const std::string& utilityName, cmCommandOrigin origin, bool excludeFromAll, - const char* workingDirectory, const std::vector<std::string>& depends, - const cmCustomCommandLines& commandLines, bool escapeOldStyle, - const char* comment, bool uses_terminal, bool command_expand_lists, - const std::string& job_pool) -{ - std::vector<std::string> no_byproducts; - return this->AddUtilityCommand( - utilityName, origin, excludeFromAll, workingDirectory, no_byproducts, - depends, commandLines, escapeOldStyle, comment, uses_terminal, - command_expand_lists, job_pool); -} - -cmTarget* cmMakefile::AddUtilityCommand( - const std::string& utilityName, cmCommandOrigin origin, bool excludeFromAll, const char* workingDirectory, const std::vector<std::string>& byproducts, const std::vector<std::string>& depends, const cmCustomCommandLines& commandLines, bool escapeOldStyle, @@ -1237,8 +1223,8 @@ cmTarget* cmMakefile::AddUtilityCommand( this->AddNewUtilityTarget(utilityName, origin, excludeFromAll); // Validate custom commands. - if (!this->ValidateCustomCommand(commandLines) || - (commandLines.empty() && depends.empty())) { + if ((commandLines.empty() && depends.empty()) || + !this->ValidateCustomCommand(commandLines)) { return target; } diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 5ea2cce..bb88bed 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -264,13 +264,6 @@ public: cmTarget* AddUtilityCommand( const std::string& utilityName, cmCommandOrigin origin, bool excludeFromAll, const char* workingDirectory, - const std::vector<std::string>& depends, - const cmCustomCommandLines& commandLines, bool escapeOldStyle = true, - const char* comment = nullptr, bool uses_terminal = false, - bool command_expand_lists = false, const std::string& job_pool = ""); - cmTarget* AddUtilityCommand( - const std::string& utilityName, cmCommandOrigin origin, - bool excludeFromAll, const char* workingDirectory, const std::vector<std::string>& byproducts, const std::vector<std::string>& depends, const cmCustomCommandLines& commandLines, bool escapeOldStyle = true, |