diff options
-rw-r--r-- | Source/cmCustomCommandTypes.h | 7 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 8 | ||||
-rw-r--r-- | Source/cmLocalGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 27 | ||||
-rw-r--r-- | Source/cmMakefile.h | 4 |
5 files changed, 16 insertions, 32 deletions
diff --git a/Source/cmCustomCommandTypes.h b/Source/cmCustomCommandTypes.h index 5c900ce1e2..324da9ef2b 100644 --- a/Source/cmCustomCommandTypes.h +++ b/Source/cmCustomCommandTypes.h @@ -27,10 +27,3 @@ enum class cmObjectLibraryCommands Reject, Accept }; - -/** Utility target output source file name. */ -struct cmUtilityOutput -{ - std::string Name; - std::string NameCMP0049; -}; diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 9f9d725563..acc4c770d3 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -4115,7 +4115,7 @@ void AppendCustomCommandToOutput(cmLocalGenerator& lg, void AddUtilityCommand(cmLocalGenerator& lg, const cmListFileBacktrace& lfbt, cmCommandOrigin origin, cmTarget* target, - const cmUtilityOutput& force, const char* workingDir, + std::string const& force, const char* workingDir, const std::vector<std::string>& byproducts, const std::vector<std::string>& depends, const cmCustomCommandLines& commandLines, @@ -4131,7 +4131,7 @@ void AddUtilityCommand(cmLocalGenerator& lg, const cmListFileBacktrace& lfbt, std::string no_main_dependency; cmImplicitDependsList no_implicit_depends; cmSourceFile* rule = AddCustomCommand( - lg, lfbt, origin, { force.Name }, byproducts, depends, no_main_dependency, + lg, lfbt, origin, { force }, byproducts, depends, no_main_dependency, no_implicit_depends, commandLines, comment, workingDir, /*replace=*/false, escapeOldStyle, uses_terminal, command_expand_lists, /*depfile=*/"", job_pool, stdPipesUTF8); @@ -4139,9 +4139,7 @@ void AddUtilityCommand(cmLocalGenerator& lg, const cmListFileBacktrace& lfbt, lg.AddTargetByproducts(target, byproducts, lfbt, origin); } - if (!force.NameCMP0049.empty()) { - target->AddSource(force.NameCMP0049); - } + target->AddSource(force); } std::vector<std::string> ComputeISPCObjectSuffixes(cmGeneratorTarget* target) diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 581badb5a5..0c7ea452d6 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -684,7 +684,7 @@ void AppendCustomCommandToOutput(cmLocalGenerator& lg, void AddUtilityCommand(cmLocalGenerator& lg, const cmListFileBacktrace& lfbt, cmCommandOrigin origin, cmTarget* target, - const cmUtilityOutput& force, const char* workingDir, + std::string const& force, const char* workingDir, const std::vector<std::string>& byproducts, const std::vector<std::string>& depends, const cmCustomCommandLines& commandLines, diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 4e9378582d..6743a893f2 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1257,25 +1257,18 @@ void cmMakefile::AppendCustomCommandToOutput( } } -cmUtilityOutput cmMakefile::GetUtilityOutput(cmTarget* target) +std::string cmMakefile::GetUtilityOutput(cmTarget* target) { std::string force = cmStrCat(this->GetCurrentBinaryDirectory(), "/CMakeFiles/", target->GetName()); - std::string forceCMP0049 = target->GetSourceCMP0049(force); - { - cmSourceFile* sf = nullptr; - if (!forceCMP0049.empty()) { - sf = this->GetOrCreateSource(forceCMP0049, false, - cmSourceFileLocationKind::Known); - } - // The output is not actually created so mark it symbolic. - if (sf) { - sf->SetProperty("SYMBOLIC", "1"); - } else { - cmSystemTools::Error("Could not get source file entry for " + force); - } + // The output is not actually created so mark it symbolic. + if (cmSourceFile* sf = this->GetOrCreateSource( + force, false, cmSourceFileLocationKind::Known)) { + sf->SetProperty("SYMBOLIC", "1"); + } else { + cmSystemTools::Error("Could not get source file entry for " + force); } - return { std::move(force), std::move(forceCMP0049) }; + return force; } cmTarget* cmMakefile::AddUtilityCommand( @@ -1295,8 +1288,8 @@ cmTarget* cmMakefile::AddUtilityCommand( } // Get the output name of the utility target and mark it generated. - cmUtilityOutput force = this->GetUtilityOutput(target); - this->GetOrCreateGeneratedSource(force.Name); + std::string force = this->GetUtilityOutput(target); + this->GetOrCreateGeneratedSource(force); // Always create the byproduct sources and mark them generated. this->CreateGeneratedOutputs(byproducts); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index a864074f6f..cab3e17461 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -243,9 +243,9 @@ public: bool excludeFromAll = false); /** - * Return the utility target output source file name and the CMP0049 name. + * Return the utility target output source file name. */ - cmUtilityOutput GetUtilityOutput(cmTarget* target); + std::string GetUtilityOutput(cmTarget* target); /** * Dispatch adding a utility to the build. A utility target is a command |