[Cmake-commits] CMake branch, next, updated. v2.8.11.2-3358-g4d81237

Stephen Kelly steveire at gmail.com
Thu Jul 25 07:54:49 EDT 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  4d81237b98a6e78a14b8731e97370377a59cc29e (commit)
       via  a8c9095d98b18a166989d8d412c3b56db63f029b (commit)
      from  342e22367377de76409c2bd535af5ec97873bbac (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4d81237b98a6e78a14b8731e97370377a59cc29e
commit 4d81237b98a6e78a14b8731e97370377a59cc29e
Merge: 342e223 a8c9095
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Jul 25 07:54:46 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Jul 25 07:54:46 2013 -0400

    Merge topic 'link-language-static-lib' into next
    
    a8c9095 Genex: Disallow LINKER_LANGUAGE only when used on a static library.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a8c9095d98b18a166989d8d412c3b56db63f029b
commit a8c9095d98b18a166989d8d412c3b56db63f029b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Jul 25 09:12:28 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Jul 25 13:52:50 2013 +0200

    Genex: Disallow LINKER_LANGUAGE only when used on a static library.
    
    For shared libraries and executables, the linker_language is
    indepenedent of the linked libraries.

diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index b59298f..084b731 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -790,11 +790,12 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
 
     if (propertyName == "LINKER_LANGUAGE")
       {
-      if (dagCheckerParent && dagCheckerParent->EvaluatingLinkLibraries())
+      if (target->LinkLanguageDependsOnLinkImplementation() &&
+          dagCheckerParent && dagCheckerParent->EvaluatingLinkLibraries())
         {
         reportError(context, content->GetOriginalExpression(),
             "LINKER_LANGUAGE target property can not be used while evaluating "
-            "link libraries");
+            "link libraries for a static library");
         return std::string();
         }
       const char *lang = target->GetLinkerLanguage(context->Config);
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 26bf9b7..dbbe36d 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -6193,7 +6193,7 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
   }
 
   // Get the link languages.
-  if(this->GetType() == cmTarget::STATIC_LIBRARY)
+  if(this->LinkLanguageDependsOnLinkImplementation())
     {
     std::string linkProp = "IMPORTED_LINK_INTERFACE_LANGUAGES";
     linkProp += suffix;
@@ -6495,7 +6495,7 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface,
     iface.ImplementationIsInterface = true;
     iface.Libraries = impl->Libraries;
     iface.WrongConfigLibraries = impl->WrongConfigLibraries;
-    if(this->GetType() == cmTarget::STATIC_LIBRARY)
+    if(this->LinkLanguageDependsOnLinkImplementation())
       {
       // Targets using this archive need its language runtime libraries.
       iface.Languages = impl->Languages;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 0da0f12..962fe5a 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -543,6 +543,9 @@ public:
 
   void FinalizeSystemIncludeDirectories();
 
+  bool LinkLanguageDependsOnLinkImplementation() const
+  { return this->TargetTypeValue == STATIC_LIBRARY; }
+
 private:
   // The set of include directories that are marked as system include
   // directories.
diff --git a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex.cmake b/Tests/RunCMake/Languages/LINK_LANGUAGE-genex.cmake
index d4e31cd..64f394c 100644
--- a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex.cmake
+++ b/Tests/RunCMake/Languages/LINK_LANGUAGE-genex.cmake
@@ -1,4 +1,4 @@
 
-add_library(foo SHARED empty.cpp)
-add_library(bar SHARED empty.cpp)
+add_library(foo STATIC empty.cpp)
+add_library(bar STATIC empty.cpp)
 target_link_libraries(foo $<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,anything>:bar>)

-----------------------------------------------------------------------

Summary of changes:
 Source/cmGeneratorExpressionEvaluator.cxx          |    5 +++--
 Source/cmTarget.cxx                                |    4 ++--
 Source/cmTarget.h                                  |    3 +++
 Tests/RunCMake/Languages/LINK_LANGUAGE-genex.cmake |    4 ++--
 4 files changed, 10 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list