Przeglądaj źródła

Don't wrap all targets in LINK_LIBRARIES in a TARGET_NAME genex.

It is not necessary and the current state is unintentional. Before
this patch,

 target_link_libraries(foo bar)

causes the LINK_LIBRARIES property of foo to contain

 $<TARGET_NAME:bar>

instead of just

 bar
Stephen Kelly 12 lat temu
rodzic
commit
d7f1520938
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3 2
      Source/cmTarget.cxx

+ 3 - 2
Source/cmTarget.cxx

@@ -2269,8 +2269,9 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
   cmTarget *tgt = this->Makefile->FindTargetToUse(lib);
   const bool isNonImportedTarget = tgt && !tgt->IsImported();
 
-  std::string libName = isNonImportedTarget ? targetNameGenex(lib)
-                                          : std::string(lib);
+  const std::string libName = (isNonImportedTarget && llt != GENERAL)
+                                                        ? targetNameGenex(lib)
+                                                        : std::string(lib);
   this->AppendProperty("LINK_LIBRARIES",
                        this->GetDebugGeneratorExpressions(libName,
                                                           llt).c_str());