summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-11-24 13:43:10 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-11-24 13:43:22 (GMT)
commit1f1d70515402eabaf06c842a7cf9a87fbb2ff58f (patch)
tree42d6c752a01c8bea46e8756e5bc171cfe6dd9736 /Source
parentaeb0e401110d8aa9ce2248b01611f7e7e01e21be (diff)
parent54ef732b0c409b3ed9376bf6cdb40d1038209ecb (diff)
downloadCMake-1f1d70515402eabaf06c842a7cf9a87fbb2ff58f.zip
CMake-1f1d70515402eabaf06c842a7cf9a87fbb2ff58f.tar.gz
CMake-1f1d70515402eabaf06c842a7cf9a87fbb2ff58f.tar.bz2
Merge topic 'policy-cmp0111-iface' into release-3.19
54ef732b0c cmVisualStudio10TargetGenerator: Avoid GetFullPath on INTERFACE library f06f4b517c cmTarget: Do not enforce CMP0111 on imported INTERFACE libraries 43c95df8fb Tests: Match RunCMake.CMP0111 stderr more strictly Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5530
Diffstat (limited to 'Source')
-rw-r--r--Source/cmTarget.cxx56
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx3
2 files changed, 31 insertions, 28 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index e076d1e..d26de9c 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2045,35 +2045,37 @@ std::string cmTarget::ImportedGetFullPath(
}
if (result.empty()) {
- auto message = [&]() -> std::string {
- std::string unset;
- std::string configuration;
-
- if (artifact == cmStateEnums::RuntimeBinaryArtifact) {
- unset = "IMPORTED_LOCATION";
- } else if (artifact == cmStateEnums::ImportLibraryArtifact) {
- unset = "IMPORTED_IMPLIB";
- }
-
- if (!config.empty()) {
- configuration = cmStrCat(" configuration \"", config, "\"");
- }
+ if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
+ auto message = [&]() -> std::string {
+ std::string unset;
+ std::string configuration;
+
+ if (artifact == cmStateEnums::RuntimeBinaryArtifact) {
+ unset = "IMPORTED_LOCATION";
+ } else if (artifact == cmStateEnums::ImportLibraryArtifact) {
+ unset = "IMPORTED_IMPLIB";
+ }
- return cmStrCat(unset, " not set for imported target \"",
- this->GetName(), "\"", configuration, ".");
- };
+ if (!config.empty()) {
+ configuration = cmStrCat(" configuration \"", config, "\"");
+ }
- switch (this->GetPolicyStatus(cmPolicies::CMP0111)) {
- case cmPolicies::WARN:
- impl->Makefile->IssueMessage(
- MessageType::AUTHOR_WARNING,
- cmPolicies::GetPolicyWarning(cmPolicies::CMP0111) + "\n" +
- message());
- CM_FALLTHROUGH;
- case cmPolicies::OLD:
- break;
- default:
- impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, message());
+ return cmStrCat(unset, " not set for imported target \"",
+ this->GetName(), "\"", configuration, ".");
+ };
+
+ switch (this->GetPolicyStatus(cmPolicies::CMP0111)) {
+ case cmPolicies::WARN:
+ impl->Makefile->IssueMessage(
+ MessageType::AUTHOR_WARNING,
+ cmPolicies::GetPolicyWarning(cmPolicies::CMP0111) + "\n" +
+ message());
+ CM_FALLTHROUGH;
+ case cmPolicies::OLD:
+ break;
+ default:
+ impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, message());
+ }
}
result = cmStrCat(this->GetName(), "-NOTFOUND");
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index a482ed6..4eb3b7f 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -3944,7 +3944,8 @@ void cmVisualStudio10TargetGenerator::AddLibraries(
if (managedType != cmGeneratorTarget::ManagedType::Native &&
this->GeneratorTarget->GetManagedType(config) !=
cmGeneratorTarget::ManagedType::Native &&
- l.Target->IsImported()) {
+ l.Target->IsImported() &&
+ l.Target->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
auto location = l.Target->GetFullPath(config);
if (!location.empty()) {
ConvertToWindowsSlash(location);