1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-16 05:26:58 +08:00

cmGeneratorTarget: return the source file added

A few callsites uses this codepath to generate `cmSourceFile` instances;
allow them to access it.
This commit is contained in:
Ben Boeckel
2025-09-03 12:58:03 -04:00
parent 43633440e9
commit 388923818d
2 changed files with 4 additions and 3 deletions

View File

@@ -566,10 +566,11 @@ void cmGeneratorTarget::AddSourceCommon(std::string const& src, bool before)
this->ClearSourcesCache(); this->ClearSourcesCache();
} }
void cmGeneratorTarget::AddSource(std::string const& src, bool before) cmSourceFile* cmGeneratorTarget::AddSource(std::string const& src, bool before)
{ {
this->Target->AddSource(src, before); auto* sf = this->Target->AddSource(src, before);
this->AddSourceCommon(src, before); this->AddSourceCommon(src, before);
return sf;
} }
void cmGeneratorTarget::AddTracedSources(std::vector<std::string> const& srcs) void cmGeneratorTarget::AddTracedSources(std::vector<std::string> const& srcs)

View File

@@ -845,7 +845,7 @@ public:
*/ */
void ClearLinkInterfaceCache(); void ClearLinkInterfaceCache();
void AddSource(std::string const& src, bool before = false); cmSourceFile* AddSource(std::string const& src, bool before = false);
void AddTracedSources(std::vector<std::string> const& srcs); void AddTracedSources(std::vector<std::string> const& srcs);
/** /**