[Cmake-commits] CMake branch, next, updated. v2.8.11.2-3428-g7a113f3

Stephen Kelly steveire at gmail.com
Fri Jul 26 11:01:53 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  7a113f3e825e2985c268ea84fe265f49c334f0fe (commit)
       via  b8dc7fad23a0b6867dae30e3cd6a23c82d6cfac9 (commit)
      from  20a0ba63263f547191193743fd8df33e04504019 (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=7a113f3e825e2985c268ea84fe265f49c334f0fe
commit 7a113f3e825e2985c268ea84fe265f49c334f0fe
Merge: 20a0ba6 b8dc7fa
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Jul 26 11:01:48 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Jul 26 11:01:48 2013 -0400

    Merge topic 'minor-cleanups' into next
    
    b8dc7fa Genex: Disallow LINKER_LANGUAGE only when used on a static library.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b8dc7fad23a0b6867dae30e3cd6a23c82d6cfac9
commit b8dc7fad23a0b6867dae30e3cd6a23c82d6cfac9
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Jul 25 09:12:28 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Jul 26 16:58:25 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..d0b6190 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->LinkLanguagePropagatesToDependents() &&
+          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 622e812..ffd4008 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -6241,7 +6241,7 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
   }
 
   // Get the link languages.
-  if(this->GetType() == cmTarget::STATIC_LIBRARY)
+  if(this->LinkLanguagePropagatesToDependents())
     {
     std::string linkProp = "IMPORTED_LINK_INTERFACE_LANGUAGES";
     linkProp += suffix;
@@ -6470,7 +6470,7 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface,
       else
         {
         iface.Libraries = impl->Libraries;
-        if(this->GetType() == cmTarget::STATIC_LIBRARY)
+        if(this->LinkLanguagePropagatesToDependents())
           {
           // Targets using this archive need its language runtime libraries.
           iface.Languages = impl->Languages;
@@ -6539,7 +6539,7 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface,
             }
           }
         }
-      if(this->GetType() == cmTarget::STATIC_LIBRARY)
+      if(this->LinkLanguagePropagatesToDependents())
         {
         // Targets using this archive need its language runtime libraries.
         iface.Languages = impl->Languages;
@@ -6558,7 +6558,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->LinkLanguagePropagatesToDependents())
       {
       // Targets using this archive need its language runtime libraries.
       iface.Languages = impl->Languages;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 24a71ed..27b74ca 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -549,6 +549,9 @@ public:
 
   void FinalizeSystemIncludeDirectories();
 
+  bool LinkLanguagePropagatesToDependents() 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                                |    8 ++++----
 Source/cmTarget.h                                  |    3 +++
 Tests/RunCMake/Languages/LINK_LANGUAGE-genex.cmake |    4 ++--
 4 files changed, 12 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list