From 03d86f9d9ce0d55ac297ea876245f0e5ac539cd0 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 5 Dec 2023 15:47:17 -0500 Subject: cmGeneratorTarget: Add helper to check for known runtime artifact --- Source/cmGeneratorTarget.cxx | 13 +++++++++++++ Source/cmGeneratorTarget.h | 1 + 2 files changed, 14 insertions(+) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 4b4d8b9..45073f7 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -1258,6 +1258,19 @@ bool cmGeneratorTarget::CanCompileSources() const 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 { static std::string location; diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 2a301e3..e6513a1 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -58,6 +58,7 @@ public: bool IsImported() const; bool IsImportedGloballyVisible() const; bool CanCompileSources() const; + bool HasKnownRuntimeArtifactLocation(std::string const& config) const; const std::string& GetLocation(const std::string& config) const; /** Get the full path to the target's main artifact, if known. */ -- cgit v0.12