mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-22 22:31:18 -05:00
cmMakefile: Create all generated byproducts as known sources
This commit is contained in:
@@ -970,8 +970,8 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Always create the output sources and mark them generated.
|
// Always create the output sources and mark them generated.
|
||||||
this->CreateGeneratedSources(outputs, cmSourceFileLocationKind::Known);
|
this->CreateGeneratedSources(outputs);
|
||||||
this->CreateGeneratedSources(byproducts, cmSourceFileLocationKind::Known);
|
this->CreateGeneratedSources(byproducts);
|
||||||
|
|
||||||
// Choose a source file on which to store the custom command.
|
// Choose a source file on which to store the custom command.
|
||||||
cmSourceFile* file = nullptr;
|
cmSourceFile* file = nullptr;
|
||||||
@@ -1239,7 +1239,7 @@ cmTarget* cmMakefile::AddUtilityCommand(
|
|||||||
// Store the custom command in the target.
|
// Store the custom command in the target.
|
||||||
if (!commandLines.empty() || !depends.empty()) {
|
if (!commandLines.empty() || !depends.empty()) {
|
||||||
// Always create the byproduct sources and mark them generated.
|
// Always create the byproduct sources and mark them generated.
|
||||||
this->CreateGeneratedSources(byproducts, cmSourceFileLocationKind::Known);
|
this->CreateGeneratedSources(byproducts);
|
||||||
|
|
||||||
std::string force =
|
std::string force =
|
||||||
cmStrCat(this->GetCurrentBinaryDirectory(), "/CMakeFiles/", utilityName);
|
cmStrCat(this->GetCurrentBinaryDirectory(), "/CMakeFiles/", utilityName);
|
||||||
@@ -3444,10 +3444,11 @@ cmSourceFile* cmMakefile::GetOrCreateSource(const std::string& sourceName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cmMakefile::CreateGeneratedSources(
|
void cmMakefile::CreateGeneratedSources(
|
||||||
const std::vector<std::string>& outputs, cmSourceFileLocationKind kind)
|
const std::vector<std::string>& outputs)
|
||||||
{
|
{
|
||||||
for (std::string const& output : outputs) {
|
for (std::string const& output : outputs) {
|
||||||
if (cmSourceFile* out = this->GetOrCreateSource(output, true, kind)) {
|
if (cmSourceFile* out = this->GetOrCreateSource(
|
||||||
|
output, true, cmSourceFileLocationKind::Known)) {
|
||||||
out->SetProperty("GENERATED", "1");
|
out->SetProperty("GENERATED", "1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-3
@@ -1067,9 +1067,7 @@ private:
|
|||||||
bool atOnly, const char* filename,
|
bool atOnly, const char* filename,
|
||||||
long line, bool replaceAt) const;
|
long line, bool replaceAt) const;
|
||||||
|
|
||||||
void CreateGeneratedSources(
|
void CreateGeneratedSources(const std::vector<std::string>& outputs);
|
||||||
const std::vector<std::string>& outputs,
|
|
||||||
cmSourceFileLocationKind kind = cmSourceFileLocationKind::Ambiguous);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* See LinearGetSourceFileWithOutput for background information
|
* See LinearGetSourceFileWithOutput for background information
|
||||||
|
|||||||
Reference in New Issue
Block a user