diff options
-rw-r--r-- | Source/cmExportBuildFileGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmFileAPICodemodel.cxx | 2 | ||||
-rw-r--r-- | Source/cmGeneratorExpressionNode.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.h | 11 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.h | 3 | ||||
-rw-r--r-- | Source/cmInstallCommand.cxx | 3 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 5 | ||||
-rw-r--r-- | Source/cmTarget.h | 2 |
9 files changed, 21 insertions, 11 deletions
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index a47f1e5..c7e1f3c 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -195,7 +195,7 @@ cmStateEnums::TargetType cmExportBuildFileGenerator::GetExportTargetType( // to support transitive usage requirements on other targets that // use the object library. if (targetType == cmStateEnums::OBJECT_LIBRARY && - !this->LG->GetGlobalGenerator()->HasKnownObjectFileLocation(nullptr)) { + !target->Target->HasKnownObjectFileLocation(nullptr)) { targetType = cmStateEnums::INTERFACE_LIBRARY; } return targetType; diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx index 40e1d2e..dd0540c 100644 --- a/Source/cmFileAPICodemodel.cxx +++ b/Source/cmFileAPICodemodel.cxx @@ -1728,7 +1728,7 @@ Json::Value Target::DumpArtifacts() // Object libraries have only object files as artifacts. if (this->GT->GetType() == cmStateEnums::OBJECT_LIBRARY) { - if (!this->GT->GetGlobalGenerator()->HasKnownObjectFileLocation(nullptr)) { + if (!this->GT->Target->HasKnownObjectFileLocation(nullptr)) { return artifacts; } std::vector<cmSourceFile const*> objectSources; diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 3d1cfbf..a9bc435 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -1785,7 +1785,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode { std::string reason; if (!context->EvaluateForBuildsystem && - !gg->HasKnownObjectFileLocation(&reason)) { + !gt->Target->HasKnownObjectFileLocation(&reason)) { std::ostringstream e; e << "The evaluation of the TARGET_OBJECTS generator expression " "is only suitable for consumption by CMake (limited" diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 5965a16..dcef070 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -459,10 +459,13 @@ public: virtual bool IsNinja() const { return false; } - /** Return true if we know the exact location of object files. - If false, store the reason in the given string. - This is meaningful only after EnableLanguage has been called. */ - virtual bool HasKnownObjectFileLocation(std::string*) const { return true; } + /** Return true if we know the exact location of object files for the given + cmTarget. If false, store the reason in the given string. This is + meaningful only after EnableLanguage has been called. */ + virtual bool HasKnownObjectFileLocation(cmTarget const&, std::string*) const + { + return true; + } virtual bool UseFolderProperty() const; diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 3ce3d59..29d7139 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -4924,7 +4924,7 @@ bool cmGlobalXCodeGenerator::IsMultiConfig() const } bool cmGlobalXCodeGenerator::HasKnownObjectFileLocation( - std::string* reason) const + cmTarget const&, std::string* reason) const { if (this->ObjectDirArch.find('$') != std::string::npos) { if (reason != nullptr) { diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index 1159d1f..92e4528 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -107,7 +107,8 @@ public: bool IsXcode() const override { return true; } - bool HasKnownObjectFileLocation(std::string* reason) const override; + bool HasKnownObjectFileLocation(cmTarget const&, + std::string* reason) const override; bool IsIPOSupported() const override { return true; } diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index 1ed698d..7de2cb1 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -919,8 +919,7 @@ bool HandleTargetsMode(std::vector<std::string> const& args, if (!objectArgs.GetDestination().empty()) { // Verify that we know where the objects are to install them. std::string reason; - if (!helper.Makefile->GetGlobalGenerator() - ->HasKnownObjectFileLocation(&reason)) { + if (!target.HasKnownObjectFileLocation(&reason)) { status.SetError( cmStrCat("TARGETS given OBJECT library \"", target.GetName(), "\" whose objects may not be installed", reason, ".")); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index e2314e2..f6952b5 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -691,6 +691,11 @@ bool cmTarget::IsAndroidGuiExecutable() const this->impl->IsAndroid && this->GetPropertyAsBool("ANDROID_GUI")); } +bool cmTarget::HasKnownObjectFileLocation(std::string* reason) const +{ + return this->GetGlobalGenerator()->HasKnownObjectFileLocation(*this, reason); +} + std::vector<cmCustomCommand> const& cmTarget::GetPreBuildCommands() const { return this->impl->PreBuildCommands; diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 0cdd2fc..edb49be 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -220,6 +220,8 @@ public: //! Return whether this target is a GUI executable on Android. bool IsAndroidGuiExecutable() const; + bool HasKnownObjectFileLocation(std::string* reason = nullptr) const; + //! Get a backtrace from the creation of the target. cmListFileBacktrace const& GetBacktrace() const; |