cmGeneratorTarget: Add helper to check for known runtime artifact

This commit is contained in:
Brad King
2023-12-05 15:47:17 -05:00
parent 3e8f021137
commit 03d86f9d9c
2 changed files with 14 additions and 0 deletions
+13
View File
@@ -1258,6 +1258,19 @@ bool cmGeneratorTarget::CanCompileSources() const
return this->Target->CanCompileSources(); return this->Target->CanCompileSources();
} }
bool cmGeneratorTarget::HasKnownRuntimeArtifactLocation(
std::string const& config) const
{
if (!this->IsRuntimeBinary()) {
return false;
}
if (!this->IsImported()) {
return true;
}
ImportInfo const* info = this->GetImportInfo(config);
return info && !info->Location.empty();
}
const std::string& cmGeneratorTarget::GetLocationForBuild() const const std::string& cmGeneratorTarget::GetLocationForBuild() const
{ {
static std::string location; static std::string location;
+1
View File
@@ -58,6 +58,7 @@ public:
bool IsImported() const; bool IsImported() const;
bool IsImportedGloballyVisible() const; bool IsImportedGloballyVisible() const;
bool CanCompileSources() const; bool CanCompileSources() const;
bool HasKnownRuntimeArtifactLocation(std::string const& config) const;
const std::string& GetLocation(const std::string& config) const; const std::string& GetLocation(const std::string& config) const;
/** Get the full path to the target's main artifact, if known. */ /** Get the full path to the target's main artifact, if known. */