[Cmake-commits] CMake branch, next, updated. v3.3.0-2096-gf08cc08

Chuck Atkins chuck.atkins at kitware.com
Fri Aug 7 15:46:23 EDT 2015


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  f08cc08dc647b09d2b5d6e0f681bd551c957db97 (commit)
       via  7ba7ce98d5f19b64c44d731344fdef26317cd69c (commit)
       via  3cefadbff07d68c5a6846835ea87cc35eae55a0b (commit)
      from  010f4f8c6a8e6d45d7f49aa083d12f65de714557 (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=f08cc08dc647b09d2b5d6e0f681bd551c957db97
commit f08cc08dc647b09d2b5d6e0f681bd551c957db97
Merge: 010f4f8 7ba7ce9
Author:     Chuck Atkins <chuck.atkins at kitware.com>
AuthorDate: Fri Aug 7 15:46:22 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Aug 7 15:46:22 2015 -0400

    Merge topic 'add-global-link-static-properties' into next
    
    7ba7ce98 Allow LINK_SEARCH_{START,END}_STATIC props to have default values.
    3cefadbf CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7ba7ce98d5f19b64c44d731344fdef26317cd69c
commit 7ba7ce98d5f19b64c44d731344fdef26317cd69c
Author:     Chuck Atkins <chuck.atkins at kitware.com>
AuthorDate: Fri Aug 7 15:11:57 2015 -0400
Commit:     Chuck Atkins <chuck.atkins at kitware.com>
CommitDate: Fri Aug 7 15:27:30 2015 -0400

    Allow LINK_SEARCH_{START,END}_STATIC props to have default values.
    
    Use the CMAKE_LINK_SEARCH_START_STATIC and CMAKE_LINK_SEARCH_END_STATIC
    variables to initialize the LINK_SEARCH_START_STATIC and
    LINK_SEARCH_END_STATIC target properties respectively.

diff --git a/Help/prop_tgt/LINK_SEARCH_END_STATIC.rst b/Help/prop_tgt/LINK_SEARCH_END_STATIC.rst
index fe105bd..cf9c871 100644
--- a/Help/prop_tgt/LINK_SEARCH_END_STATIC.rst
+++ b/Help/prop_tgt/LINK_SEARCH_END_STATIC.rst
@@ -10,5 +10,9 @@ paths are not known or (in some cases) are in implicit link
 directories for the platform.  By default CMake adds an option at the
 end of the library list (if necessary) to set the linker search type
 back to its starting type.  This property switches the final linker
-search type to -Bstatic regardless of how it started.  See also
-LINK_SEARCH_START_STATIC.
+search type to -Bstatic regardless of how it started.
+
+This property is initialized by the value of the variable
+CMAKE_LINK_SEARCH_END_STATIC if it is set when a target is created.
+
+See also LINK_SEARCH_START_STATIC.
diff --git a/Help/prop_tgt/LINK_SEARCH_START_STATIC.rst b/Help/prop_tgt/LINK_SEARCH_START_STATIC.rst
index ca899fe..2e0f9bd 100644
--- a/Help/prop_tgt/LINK_SEARCH_START_STATIC.rst
+++ b/Help/prop_tgt/LINK_SEARCH_START_STATIC.rst
@@ -11,4 +11,9 @@ directories for the platform.  By default the linker search type is
 assumed to be -Bdynamic at the beginning of the library list.  This
 property switches the assumption to -Bstatic.  It is intended for use
 when linking an executable statically (e.g.  with the GNU -static
-option).  See also LINK_SEARCH_END_STATIC.
+option).
+
+This property is initialized by the value of the variable
+CMAKE_LINK_SEARCH_START_STATIC if it is set when a target is created.
+
+See also LINK_SEARCH_END_STATIC.
diff --git a/Help/prop_tgt/LINK_SEARCH_END_STATIC.rst b/Help/variable/CMAKE_LINK_SEARCH_END_STATIC.rst
similarity index 68%
copy from Help/prop_tgt/LINK_SEARCH_END_STATIC.rst
copy to Help/variable/CMAKE_LINK_SEARCH_END_STATIC.rst
index fe105bd..8a9951d 100644
--- a/Help/prop_tgt/LINK_SEARCH_END_STATIC.rst
+++ b/Help/variable/CMAKE_LINK_SEARCH_END_STATIC.rst
@@ -1,5 +1,5 @@
-LINK_SEARCH_END_STATIC
-----------------------
+CMAKE_LINK_SEARCH_END_STATIC
+----------------------------
 
 End a link line such that static system libraries are used.
 
@@ -10,5 +10,9 @@ paths are not known or (in some cases) are in implicit link
 directories for the platform.  By default CMake adds an option at the
 end of the library list (if necessary) to set the linker search type
 back to its starting type.  This property switches the final linker
-search type to -Bstatic regardless of how it started.  See also
-LINK_SEARCH_START_STATIC.
+search type to -Bstatic regardless of how it started.
+
+This variable is used to initialize the target property
+LINK_SEARCH_END_STATIC for all targets.
+
+See also CMAKE_LINK_SEARCH_START_STATIC.
diff --git a/Help/prop_tgt/LINK_SEARCH_START_STATIC.rst b/Help/variable/CMAKE_LINK_SEARCH_START_STATIC.rst
similarity index 73%
copy from Help/prop_tgt/LINK_SEARCH_START_STATIC.rst
copy to Help/variable/CMAKE_LINK_SEARCH_START_STATIC.rst
index ca899fe..715db4b 100644
--- a/Help/prop_tgt/LINK_SEARCH_START_STATIC.rst
+++ b/Help/variable/CMAKE_LINK_SEARCH_START_STATIC.rst
@@ -1,5 +1,5 @@
-LINK_SEARCH_START_STATIC
-------------------------
+CMAKE_LINK_SEARCH_START_STATIC
+------------------------------
 
 Assume the linker looks for static libraries by default.
 
@@ -11,4 +11,9 @@ directories for the platform.  By default the linker search type is
 assumed to be -Bdynamic at the beginning of the library list.  This
 property switches the assumption to -Bstatic.  It is intended for use
 when linking an executable statically (e.g.  with the GNU -static
-option).  See also LINK_SEARCH_END_STATIC.
+option).
+
+This variable is used to initialize the target property
+LINK_SEARCH_START_STATIC for all targets.
+
+See also CMAKE_LINK_SEARCH_END_STATIC.
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index c3f36af..dff223f 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -520,9 +520,10 @@ bool cmComputeLinkInformation::Compute()
   // libraries are found.
   const char* lss =
       this->Target->Target->GetProperty("LINK_SEARCH_END_STATIC");
-  if(cmSystemTools::IsOn(lss))
+  if(lss)
     {
-    this->SetCurrentLinkType(LinkStatic);
+    this->SetCurrentLinkType(
+      cmSystemTools::IsOn(lss) ? LinkStatic : LinkShared);
     }
   else
     {
@@ -864,7 +865,8 @@ void cmComputeLinkInformation::ComputeLinkTypeInfo()
   const char* lss =
       this->Target->Target->GetProperty("LINK_SEARCH_START_STATIC");
   this->StartLinkType = cmSystemTools::IsOn(lss)? LinkStatic : LinkShared;
-  this->CurrentLinkType = this->StartLinkType;
+  this->CurrentLinkType = LinkUnknown;
+  this->SetCurrentLinkType(this->StartLinkType);
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 1f8f07a..51e6a66 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -306,6 +306,8 @@ void cmTarget::SetMakefile(cmMakefile* mf)
     this->SetPropertyDefault("CXX_STANDARD", 0);
     this->SetPropertyDefault("CXX_STANDARD_REQUIRED", 0);
     this->SetPropertyDefault("CXX_EXTENSIONS", 0);
+    this->SetPropertyDefault("LINK_SEARCH_START_STATIC", 0);
+    this->SetPropertyDefault("LINK_SEARCH_END_STATIC", 0);
     }
 
   // Collect the set of configuration types.
diff --git a/Tests/LinkStatic/CMakeLists.txt b/Tests/LinkStatic/CMakeLists.txt
index 200d4e5..264c85f 100644
--- a/Tests/LinkStatic/CMakeLists.txt
+++ b/Tests/LinkStatic/CMakeLists.txt
@@ -25,3 +25,39 @@ set(LinkStatic_FLAG "-static" CACHE STRING "Flag to link statically")
 set_property(TARGET LinkStatic PROPERTY LINK_FLAGS "${LinkStatic_FLAG}")
 set_property(TARGET LinkStatic PROPERTY LINK_SEARCH_START_STATIC 1)
 #set_property(TARGET LinkStatic PROPERTY LINK_SEARCH_END_STATIC 1) # insufficient
+
+set(CMAKE_LINK_SEARCH_START_STATIC ON)
+add_executable(LinkStaticInitStart1 LinkStatic.c)
+get_property(LSSS TARGET LinkStaticInitStart1
+  PROPERTY LINK_SEARCH_START_STATIC)
+if(NOT LSSS)
+  message(FATAL_ERROR "Failed to correctly initialize LINK_SEARCH_START_STATIC")
+endif()
+
+set(CMAKE_LINK_SEARCH_START_STATIC OFF)
+add_executable(LinkStaticInitStart2 LinkStatic.c)
+get_property(LSSS TARGET LinkStaticInitStart2
+  PROPERTY LINK_SEARCH_START_STATIC)
+if(LSSS)
+  message(FATAL_ERROR "Failed to correctly initialize LINK_SEARCH_START_STATIC")
+endif()
+
+unset(CMAKE_LINK_SEARCH_START_STATIC)
+
+set(CMAKE_LINK_SEARCH_END_STATIC ON)
+add_executable(LinkStaticInitEnd1 LinkStatic.c)
+get_property(LSES TARGET LinkStaticInitEnd1
+  PROPERTY LINK_SEARCH_END_STATIC)
+if(NOT LSES)
+  message(FATAL_ERROR "Failed to correctly initialize LINK_SEARCH_END_STATIC")
+endif()
+
+set(CMAKE_LINK_SEARCH_END_STATIC OFF)
+add_executable(LinkStaticInitEnd2 LinkStatic.c)
+get_property(LSES TARGET LinkStaticInitEnd2
+  PROPERTY LINK_SEARCH_END_STATIC)
+if(LSES)
+  message(FATAL_ERROR "Failed to correctly initialize LINK_SEARCH_END_STATIC")
+endif()
+
+unset(CMAKE_LINK_SEARCH_END_STATIC)

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

Summary of changes:
 Help/prop_tgt/LINK_SEARCH_END_STATIC.rst           |    8 +++--
 Help/prop_tgt/LINK_SEARCH_START_STATIC.rst         |    7 +++-
 .../CMAKE_LINK_SEARCH_END_STATIC.rst}              |   12 ++++---
 .../CMAKE_LINK_SEARCH_START_STATIC.rst}            |   11 ++++--
 Source/CMakeVersion.cmake                          |    2 +-
 Source/cmComputeLinkInformation.cxx                |    8 +++--
 Source/cmTarget.cxx                                |    2 ++
 Tests/LinkStatic/CMakeLists.txt                    |   36 ++++++++++++++++++++
 8 files changed, 72 insertions(+), 14 deletions(-)
 copy Help/{prop_tgt/LINK_SEARCH_END_STATIC.rst => variable/CMAKE_LINK_SEARCH_END_STATIC.rst} (68%)
 copy Help/{prop_tgt/LINK_SEARCH_START_STATIC.rst => variable/CMAKE_LINK_SEARCH_START_STATIC.rst} (73%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list