[Cmake-commits] CMake branch, next, updated. v3.3.2-3168-gf7b4f40

Brad King brad.king at kitware.com
Mon Sep 21 10:20:56 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  f7b4f40af838f66acbef763f215d697dd12cdff6 (commit)
       via  b15f4e9b86bc3dc31b6a01c0ffc30747f467ec1f (commit)
       via  9784af1b50a142c0160058734c7e12cee5f2a15e (commit)
      from  8831ba64a606c4eae7e16e41a83533711c075bf0 (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=f7b4f40af838f66acbef763f215d697dd12cdff6
commit f7b4f40af838f66acbef763f215d697dd12cdff6
Merge: 8831ba6 b15f4e9
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Sep 21 10:20:54 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Sep 21 10:20:54 2015 -0400

    Merge topic 'restrict-shlib-link-flags-to-enable-exports' into next
    
    b15f4e9b try_compile: Propogate CMP0065 to the generated project.
    9784af1b CMP0065: Restrict the use of CMAKE_SHARED_LIBRARY_LINK_<LANG>_FLAGS


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b15f4e9b86bc3dc31b6a01c0ffc30747f467ec1f
commit b15f4e9b86bc3dc31b6a01c0ffc30747f467ec1f
Author:     Chuck Atkins <chuck.atkins at kitware.com>
AuthorDate: Mon Aug 24 22:56:31 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Sep 21 10:12:13 2015 -0400

    try_compile: Propogate CMP0065 to the generated project.
    
    Set policy CMP0065 to the value used in the calling project.
    
    Set the the value of CMAKE_ENABLE_EXPORTS if set in the calling
    project to initialize the target property appropriately.

diff --git a/Help/command/try_compile.rst b/Help/command/try_compile.rst
index 1ed24df..28dae80 100644
--- a/Help/command/try_compile.rst
+++ b/Help/command/try_compile.rst
@@ -100,6 +100,7 @@ If set, the following variables are passed in to the generated
 try_compile CMakeLists.txt to initialize compile target properties with
 default values:
 
+* :variable:`CMAKE_ENABLE_EXPORTS`
 * :variable:`CMAKE_LINK_SEARCH_START_STATIC`
 * :variable:`CMAKE_LINK_SEARCH_END_STATIC`
 * :variable:`CMAKE_POSITION_INDEPENDENT_CODE`
@@ -107,5 +108,7 @@ default values:
 If :policy:`CMP0056` is set to ``NEW``, then
 :variable:`CMAKE_EXE_LINKER_FLAGS` is passed in as well.
 
+The current setting of :policy:`CMP0065` is set in the generated project.
+
 Set the :variable:`CMAKE_TRY_COMPILE_CONFIGURATION` variable to choose
 a build configuration.
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 9411555..e489ad2 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -481,6 +481,16 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
       fprintf(fout, "set(CMAKE_LINK_SEARCH_END_STATIC \"%s\")\n", lssDef);
       }
 
+    /* Set the appropriate policy information for ENABLE_EXPORTS */
+    fprintf(fout, "cmake_policy(SET CMP0065 %s)\n",
+       this->Makefile->GetPolicyStatus(cmPolicies::CMP0065) ==
+         cmPolicies::NEW ? "NEW" : "OLD");
+    if(const char *ee = this->Makefile->GetDefinition(
+        "CMAKE_ENABLE_EXPORTS"))
+      {
+      fprintf(fout, "set(CMAKE_ENABLE_EXPORTS %s)\n", ee);
+      }
+
     /* Put the executable at a known location (for COPY_FILE).  */
     fprintf(fout, "set(CMAKE_RUNTIME_OUTPUT_DIRECTORY \"%s\")\n",
             this->BinaryDirectory.c_str());

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9784af1b50a142c0160058734c7e12cee5f2a15e
commit 9784af1b50a142c0160058734c7e12cee5f2a15e
Author:     Chuck Atkins <chuck.atkins at kitware.com>
AuthorDate: Mon Aug 24 14:33:31 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Sep 21 10:12:13 2015 -0400

    CMP0065: Restrict the use of CMAKE_SHARED_LIBRARY_LINK_<LANG>_FLAGS
    
    This new policy restricts the addition of the shared library link flags
    to executables only when the ENABLE_EXPORTS property is set to True.

diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 590f10d..ae5354f 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -122,3 +122,4 @@ All Policies
    /policy/CMP0062
    /policy/CMP0063
    /policy/CMP0064
+   /policy/CMP0065
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 660d544..e679962 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -245,6 +245,7 @@ Variables that Control the Build
    /variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG
    /variable/CMAKE_CONFIG_POSTFIX
    /variable/CMAKE_DEBUG_POSTFIX
+   /variable/CMAKE_ENABLE_EXPORTS
    /variable/CMAKE_EXE_LINKER_FLAGS_CONFIG
    /variable/CMAKE_EXE_LINKER_FLAGS
    /variable/CMAKE_Fortran_FORMAT
diff --git a/Help/policy/CMP0065.rst b/Help/policy/CMP0065.rst
new file mode 100644
index 0000000..2ed775d
--- /dev/null
+++ b/Help/policy/CMP0065.rst
@@ -0,0 +1,27 @@
+CMP0065
+-------
+
+Do not add flags to export symbols from executables without
+the :prop_tgt:`ENABLE_EXPORTS` target property.
+
+CMake 3.3 and below, for historical reasons, always linked executables
+on some platforms with flags like ``-rdynamic`` to export symbols from
+the executables for use by any plugins they may load via ``dlopen``.
+CMake 3.4 and above prefer to do this only for executables that are
+explicitly marked with the :prop_tgt:`ENABLE_EXPORTS` target property.
+
+The ``OLD`` behavior of this policy is to always use the additional link
+flags when linking executables regardless of the value of the
+:prop_tgt:`ENABLE_EXPORTS` target property.
+
+The ``NEW`` behavior of this policy is to only use the additional link
+flags when linking executables if the :prop_tgt:`ENABLE_EXPORTS` target
+property is set to ``True``.
+
+This policy was introduced in CMake version 3.4.  Unlike most policies,
+CMake version |release| does *not* warn by default when this policy
+is not set and simply uses OLD behavior.  See documentation of the
+:variable:`CMAKE_POLICY_WARNING_CMP0065 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
+variable to control the warning.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/prop_tgt/ENABLE_EXPORTS.rst b/Help/prop_tgt/ENABLE_EXPORTS.rst
index 283f5a8..dfd4af7 100644
--- a/Help/prop_tgt/ENABLE_EXPORTS.rst
+++ b/Help/prop_tgt/ENABLE_EXPORTS.rst
@@ -7,7 +7,7 @@ Normally an executable does not export any symbols because it is the
 final program.  It is possible for an executable to export symbols to
 be used by loadable modules.  When this property is set to true CMake
 will allow other targets to "link" to the executable with the
-TARGET_LINK_LIBRARIES command.  On all platforms a target-level
+:command:`TARGET_LINK_LIBRARIES` command.  On all platforms a target-level
 dependency on the executable is created for targets that link to it.
 For DLL platforms an import library will be created for the exported
 symbols and then used for linking.  All Windows-based systems
@@ -17,3 +17,6 @@ module will "link" to the executable using a flag like
 "-bundle_loader".  For other non-DLL platforms the link rule is simply
 ignored since the dynamic loader will automatically bind symbols when
 the module is loaded.
+
+This property is initialized by the value of the variable
+:variable:`CMAKE_ENABLE_EXPORTS` if it is set when a target is created.
diff --git a/Help/release/dev/restrict-shlib-link-flags-to-enable-exports.rst b/Help/release/dev/restrict-shlib-link-flags-to-enable-exports.rst
new file mode 100644
index 0000000..f8ce044
--- /dev/null
+++ b/Help/release/dev/restrict-shlib-link-flags-to-enable-exports.rst
@@ -0,0 +1,6 @@
+restrict-shlib-link-flags-to-enable-exports
+-------------------------------------------
+
+* CMake no longer links executables with flags to export symbols
+  unless the :prop_tgt:`ENABLE_EXPORTS` target property is set.
+  See policy :policy:`CMP0065`.
diff --git a/Help/prop_tgt/ENABLE_EXPORTS.rst b/Help/variable/CMAKE_ENABLE_EXPORTS.rst
similarity index 79%
copy from Help/prop_tgt/ENABLE_EXPORTS.rst
copy to Help/variable/CMAKE_ENABLE_EXPORTS.rst
index 283f5a8..1f9ba6f 100644
--- a/Help/prop_tgt/ENABLE_EXPORTS.rst
+++ b/Help/variable/CMAKE_ENABLE_EXPORTS.rst
@@ -1,5 +1,5 @@
-ENABLE_EXPORTS
---------------
+CMAKE_ENABLE_EXPORTS
+--------------------
 
 Specify whether an executable exports symbols for loadable modules.
 
@@ -7,7 +7,7 @@ Normally an executable does not export any symbols because it is the
 final program.  It is possible for an executable to export symbols to
 be used by loadable modules.  When this property is set to true CMake
 will allow other targets to "link" to the executable with the
-TARGET_LINK_LIBRARIES command.  On all platforms a target-level
+:command:`TARGET_LINK_LIBRARIES` command.  On all platforms a target-level
 dependency on the executable is created for targets that link to it.
 For DLL platforms an import library will be created for the exported
 symbols and then used for linking.  All Windows-based systems
@@ -17,3 +17,6 @@ module will "link" to the executable using a flag like
 "-bundle_loader".  For other non-DLL platforms the link rule is simply
 ignored since the dynamic loader will automatically bind symbols when
 the module is loaded.
+
+This variable is used to initialize the target property
+:prop_tgt:`ENABLE_EXPORTS` for executable targets.
diff --git a/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst
index 8de0d56..582f9e4 100644
--- a/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst
+++ b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst
@@ -13,6 +13,8 @@ warn by default:
   policy :policy:`CMP0056`.
 * ``CMAKE_POLICY_WARNING_CMP0060`` controls the warning for
   policy :policy:`CMP0060`.
+* ``CMAKE_POLICY_WARNING_CMP0065`` controls the warning for
+  policy :policy:`CMP0065`.
 
 This variable should not be set by a project in CMake code.  Project
 developers running CMake may set this variable in their cache to
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 4418ead..6c7b194 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1540,13 +1540,47 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
     this->Makefile->GetSafeDefinition("CMAKE_LIBRARY_PATH_TERMINATOR");
 
   // Flags to link an executable to shared libraries.
-  std::string linkFlagsVar = "CMAKE_SHARED_LIBRARY_LINK_";
-  linkFlagsVar += linkLanguage;
-  linkFlagsVar += "_FLAGS";
   if( tgt.GetType() == cmTarget::EXECUTABLE )
     {
-    linkLibs = this->Makefile->GetSafeDefinition(linkFlagsVar);
-    linkLibs += " ";
+    bool add_shlib_flags = false;
+    switch(tgt.Target->GetPolicyStatusCMP0065())
+      {
+      case cmPolicies::WARN:
+        if(!tgt.GetPropertyAsBool("ENABLE_EXPORTS") &&
+           this->Makefile->PolicyOptionalWarningEnabled(
+             "CMAKE_POLICY_WARNING_CMP0065"))
+          {
+          std::ostringstream w;
+          w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0065) << "\n"
+            "For compatibility with older versions of CMake, "
+            "additional flags may be added to export symbols on all "
+            "executables regardless of thier ENABLE_EXPORTS property.";
+          this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+          }
+      case cmPolicies::OLD:
+        // OLD behavior is to always add the flags
+        add_shlib_flags = true;
+        break;
+      case cmPolicies::REQUIRED_IF_USED:
+      case cmPolicies::REQUIRED_ALWAYS:
+        this->Makefile->IssueMessage(
+          cmake::FATAL_ERROR,
+          cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0065)
+          );
+      case cmPolicies::NEW:
+        // NEW behavior is to only add the flags if ENABLE_EXPORTS is on
+        add_shlib_flags = tgt.GetPropertyAsBool("ENABLE_EXPORTS");
+        break;
+      }
+
+    if(add_shlib_flags)
+      {
+      std::string linkFlagsVar = "CMAKE_SHARED_LIBRARY_LINK_";
+      linkFlagsVar += linkLanguage;
+      linkFlagsVar += "_FLAGS";
+      linkLibs = this->Makefile->GetSafeDefinition(linkFlagsVar);
+      linkLibs += " ";
+      }
     }
 
   // Append the framework search path flags.
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index b20c7a9..283f277 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -220,6 +220,10 @@ class cmPolicy;
     3, 3, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0064, \
     "Support new TEST if() operator.", \
+    3, 4, 0, cmPolicies::WARN) \
+  SELECT(POLICY, CMP0065, \
+    "Do not add flags to export symbols from executables without " \
+    "the ENABLE_EXPORTS target property.", \
     3, 4, 0, cmPolicies::WARN)
 
 #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 13e0d7e..bb44956 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -347,6 +347,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
     {
     this->SetPropertyDefault("ANDROID_GUI", 0);
     this->SetPropertyDefault("CROSSCOMPILING_EMULATOR", 0);
+    this->SetPropertyDefault("ENABLE_EXPORTS", 0);
     }
   if(this->TargetTypeValue == cmTarget::SHARED_LIBRARY
       || this->TargetTypeValue == cmTarget::MODULE_LIBRARY)
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index c86ec24..3e71dbd 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -41,7 +41,8 @@
   F(CMP0046) \
   F(CMP0052) \
   F(CMP0060) \
-  F(CMP0063)
+  F(CMP0063) \
+  F(CMP0065)
 
 class cmake;
 class cmMakefile;
diff --git a/Tests/RunCMake/CMP0065/BuildTargetInSubProject.cmake b/Tests/RunCMake/CMP0065/BuildTargetInSubProject.cmake
new file mode 100644
index 0000000..9339e46
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/BuildTargetInSubProject.cmake
@@ -0,0 +1,15 @@
+function(BuildTargetInSubProject P T E)
+  try_compile(RESULTVAR
+    ${CMAKE_CURRENT_BINARY_DIR}/subproject
+    ${CMAKE_CURRENT_SOURCE_DIR}/subproject
+    ${P} ${T} OUTPUT_VARIABLE O)
+  if(E AND RESULTVAR)
+    message(STATUS "${P} target ${T} succeeded as expected")
+  elseif(E AND NOT RESULTVAR)
+    message(FATAL_ERROR "${P} target ${T} failed but should have succeeded.  Output:${O}")
+  elseif(NOT E AND NOT RESULTVAR)
+    message(STATUS "${P} target ${T} failed as expected")
+  elseif(NOT E AND RESULTVAR)
+    message(FATAL_ERROR "${P} target ${T} succeeded but should have failed.  Output:${O}")
+  endif()
+endfunction()
diff --git a/Tests/RunCMake/CMP0065/CMakeLists.txt b/Tests/RunCMake/CMP0065/CMakeLists.txt
new file mode 100644
index 0000000..74b3ff8
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.3)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0065/NEWBad.cmake b/Tests/RunCMake/CMP0065/NEWBad.cmake
new file mode 100644
index 0000000..79d9adb
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/NEWBad.cmake
@@ -0,0 +1,4 @@
+enable_language(C)
+include(BuildTargetInSubProject.cmake)
+
+BuildTargetInSubProject(TestPolicyCMP0065 FooNEWBad FALSE)
diff --git a/Tests/RunCMake/CMP0065/NEWGood.cmake b/Tests/RunCMake/CMP0065/NEWGood.cmake
new file mode 100644
index 0000000..a5b5d04
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/NEWGood.cmake
@@ -0,0 +1,4 @@
+enable_language(C)
+include(BuildTargetInSubProject.cmake)
+
+BuildTargetInSubProject(TestPolicyCMP0065 FooNEWGood TRUE)
diff --git a/Tests/RunCMake/CMP0065/OLDBad1.cmake b/Tests/RunCMake/CMP0065/OLDBad1.cmake
new file mode 100644
index 0000000..6d780b4
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/OLDBad1.cmake
@@ -0,0 +1,4 @@
+enable_language(C)
+include(BuildTargetInSubProject.cmake)
+
+BuildTargetInSubProject(TestPolicyCMP0065 FooOLDBad1 FALSE)
diff --git a/Tests/RunCMake/CMP0065/OLDBad2.cmake b/Tests/RunCMake/CMP0065/OLDBad2.cmake
new file mode 100644
index 0000000..7196473
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/OLDBad2.cmake
@@ -0,0 +1,4 @@
+enable_language(C)
+include(BuildTargetInSubProject.cmake)
+
+BuildTargetInSubProject(TestPolicyCMP0065 FooOLDBad2 FALSE)
diff --git a/Tests/RunCMake/CMP0065/RunCMakeTest.cmake b/Tests/RunCMake/CMP0065/RunCMakeTest.cmake
new file mode 100644
index 0000000..254a4ec
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/RunCMakeTest.cmake
@@ -0,0 +1,8 @@
+include(RunCMake)
+
+run_cmake(OLDBad1)
+run_cmake(OLDBad2)
+run_cmake(NEWBad)
+run_cmake(NEWGood)
+run_cmake(WARN-OFF)
+run_cmake(WARN-ON)
diff --git a/Tests/RunCMake/CMP0065/WARN-OFF.cmake b/Tests/RunCMake/CMP0065/WARN-OFF.cmake
new file mode 100644
index 0000000..dbc9562
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/WARN-OFF.cmake
@@ -0,0 +1,3 @@
+
+enable_language(C)
+add_executable(main subproject/main.c)
diff --git a/Tests/RunCMake/CMP0065/WARN-ON-stderr.txt b/Tests/RunCMake/CMP0065/WARN-ON-stderr.txt
new file mode 100644
index 0000000..dda4fe5
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/WARN-ON-stderr.txt
@@ -0,0 +1,10 @@
+CMake Warning \(dev\) in CMakeLists.txt:
+  Policy CMP0065 is not set: Do not add flags to export symbols from
+  executables without the ENABLE_EXPORTS target property.  Run "cmake
+  --help-policy CMP0065" for policy details.  Use the cmake_policy command to
+  set the policy and suppress this warning.
+
+  For compatibility with older versions of CMake, additional flags may be
+  added to export symbols on all executables regardless of thier
+  ENABLE_EXPORTS property.
+This warning is for project developers.  Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0065/WARN-ON.cmake b/Tests/RunCMake/CMP0065/WARN-ON.cmake
new file mode 100644
index 0000000..6ed4a41
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/WARN-ON.cmake
@@ -0,0 +1,3 @@
+set(CMAKE_POLICY_WARNING_CMP0065 1)
+enable_language(C)
+add_executable(main subproject/main.c)
diff --git a/Tests/RunCMake/CMP0065/subproject/CMakeLists.txt b/Tests/RunCMake/CMP0065/subproject/CMakeLists.txt
new file mode 100644
index 0000000..bed5960
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/subproject/CMakeLists.txt
@@ -0,0 +1,22 @@
+cmake_minimum_required(VERSION 3.3)
+
+project(TestPolicyCMP0065 C)
+set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS BADFLAGS)
+
+#----------------------------------------------------------------------
+cmake_policy(SET CMP0065 OLD)
+add_executable(FooOLDBad1 main.c)
+
+#----------------------------------------------------------------------
+cmake_policy(SET CMP0065 OLD)
+add_executable(FooOLDBad2 main.c)
+set_target_properties(FooOLDBad2 PROPERTIES ENABLE_EXPORTS ON)
+
+#----------------------------------------------------------------------
+cmake_policy(SET CMP0065 NEW)
+add_executable(FooNEWGood main.c)
+
+#----------------------------------------------------------------------
+cmake_policy(SET CMP0065 NEW)
+add_executable(FooNEWBad main.c)
+set_target_properties(FooNEWBad PROPERTIES ENABLE_EXPORTS ON)
diff --git a/Tests/RunCMake/CMP0065/subproject/main.c b/Tests/RunCMake/CMP0065/subproject/main.c
new file mode 100644
index 0000000..98725db
--- /dev/null
+++ b/Tests/RunCMake/CMP0065/subproject/main.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+int main(int argc, char **argv)
+{
+  printf("Hello World\n");
+  return 0;
+}
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index a8f9386..f11d20c 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -104,6 +104,13 @@ add_RunCMake_test(CMP0057)
 add_RunCMake_test(CMP0059)
 add_RunCMake_test(CMP0060)
 add_RunCMake_test(CMP0064)
+
+# The test for Policy 65 requires the use of the
+# CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS variable, which both the VS and Xcode
+# generators ignore.  The policy will have no effect on those generators.
+if(NOT CMAKE_GENERATOR MATCHES "Visual Studio|Xcode")
+  add_RunCMake_test(CMP0065)
+endif()
 if(CMAKE_GENERATOR MATCHES "Make")
   add_RunCMake_test(Make)
 endif()
diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
index d0aa995..57047fb 100644
--- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
+++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
@@ -19,6 +19,7 @@
    \* CMP0052
    \* CMP0060
    \* CMP0063
+   \* CMP0065
 
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)

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

Summary of changes:
 Help/command/try_compile.rst                       |    3 ++
 Help/manual/cmake-policies.7.rst                   |    1 +
 Help/manual/cmake-variables.7.rst                  |    1 +
 Help/policy/CMP0065.rst                            |   27 ++++++++++++
 Help/prop_tgt/ENABLE_EXPORTS.rst                   |    5 ++-
 ...restrict-shlib-link-flags-to-enable-exports.rst |    6 +++
 .../CMAKE_ENABLE_EXPORTS.rst}                      |    9 ++--
 Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst     |    2 +
 Source/cmCoreTryCompile.cxx                        |   10 +++++
 Source/cmLocalGenerator.cxx                        |   44 +++++++++++++++++---
 Source/cmPolicies.h                                |    4 ++
 Source/cmTarget.cxx                                |    1 +
 Source/cmTarget.h                                  |    3 +-
 .../RunCMake/CMP0065/BuildTargetInSubProject.cmake |   15 +++++++
 .../{BuildDepends => CMP0065}/CMakeLists.txt       |    0
 Tests/RunCMake/CMP0065/NEWBad.cmake                |    4 ++
 Tests/RunCMake/CMP0065/NEWGood.cmake               |    4 ++
 Tests/RunCMake/CMP0065/OLDBad1.cmake               |    4 ++
 Tests/RunCMake/CMP0065/OLDBad2.cmake               |    4 ++
 Tests/RunCMake/CMP0065/RunCMakeTest.cmake          |    8 ++++
 Tests/RunCMake/CMP0065/WARN-OFF.cmake              |    3 ++
 Tests/RunCMake/CMP0065/WARN-ON-stderr.txt          |   10 +++++
 Tests/RunCMake/CMP0065/WARN-ON.cmake               |    3 ++
 Tests/RunCMake/CMP0065/subproject/CMakeLists.txt   |   22 ++++++++++
 .../main.cpp => CMP0065/subproject/main.c}         |    2 +
 Tests/RunCMake/CMakeLists.txt                      |    7 ++++
 .../RunCMake/TargetPolicies/PolicyList-stderr.txt  |    1 +
 27 files changed, 193 insertions(+), 10 deletions(-)
 create mode 100644 Help/policy/CMP0065.rst
 create mode 100644 Help/release/dev/restrict-shlib-link-flags-to-enable-exports.rst
 copy Help/{prop_tgt/ENABLE_EXPORTS.rst => variable/CMAKE_ENABLE_EXPORTS.rst} (79%)
 create mode 100644 Tests/RunCMake/CMP0065/BuildTargetInSubProject.cmake
 copy Tests/RunCMake/{BuildDepends => CMP0065}/CMakeLists.txt (100%)
 create mode 100644 Tests/RunCMake/CMP0065/NEWBad.cmake
 create mode 100644 Tests/RunCMake/CMP0065/NEWGood.cmake
 create mode 100644 Tests/RunCMake/CMP0065/OLDBad1.cmake
 create mode 100644 Tests/RunCMake/CMP0065/OLDBad2.cmake
 create mode 100644 Tests/RunCMake/CMP0065/RunCMakeTest.cmake
 create mode 100644 Tests/RunCMake/CMP0065/WARN-OFF.cmake
 create mode 100644 Tests/RunCMake/CMP0065/WARN-ON-stderr.txt
 create mode 100644 Tests/RunCMake/CMP0065/WARN-ON.cmake
 create mode 100644 Tests/RunCMake/CMP0065/subproject/CMakeLists.txt
 copy Tests/RunCMake/{CompatibleInterface/main.cpp => CMP0065/subproject/main.c} (51%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list