[Cmake-commits] CMake branch, next, updated. v2.8.5-1546-ga8ce92a

Stephen Kelly steveire at gmail.com
Sat Aug 13 17:51:09 EDT 2011


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  a8ce92abf0226cde3a55a440ff4b34897c99f475 (commit)
       via  2aeab4f973144fe859d5751e969512a92ae08d96 (commit)
       via  c41c68bfa437d4ea1b2ae5153f6f20430c47d902 (commit)
       via  aed84517c942a4c40f493fcf997cdf6a047349f8 (commit)
       via  c448b09ad39c35b129d7b91710bea4f26fabdfe4 (commit)
      from  dbdd8ec53e935a67bf9f60964f3971e0c76eecea (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=a8ce92abf0226cde3a55a440ff4b34897c99f475
commit a8ce92abf0226cde3a55a440ff4b34897c99f475
Merge: dbdd8ec 2aeab4f
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 13 17:51:08 2011 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Aug 13 17:51:08 2011 -0400

    Merge topic 'generate_export_header' into next
    
    2aeab4f Borland can't do deprecated.
    c41c68b Try to error on deprecated on Intel and SunCC.
    aed8451 Test for deprecated attribute before declspec.
    c448b09 Perform the -Werror test only once.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2aeab4f973144fe859d5751e969512a92ae08d96
commit 2aeab4f973144fe859d5751e969512a92ae08d96
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 13 23:30:35 2011 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 13 23:49:17 2011 +0200

    Borland can't do deprecated.

diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake
index 044e2b4..5b42b77 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -158,11 +158,15 @@ macro(_test_compiler_hidden_visibility)
 endmacro()
 
 macro(_test_compiler_has_deprecated)
-  _check_cxx_compiler_attribute("__attribute__((__deprecated__))" COMPILER_HAS_DEPRECATED_ATTR)
-  if(COMPILER_HAS_DEPRECATED_ATTR)
-    set(COMPILER_HAS_DEPRECATED "${COMPILER_HAS_DEPRECATED_ATTR}" CACHE INTERNAL "Compiler support for a deprecated attribute")
+  if("${CMAKE_CXX_COMPILER_ID}" MATCHES Borland)
+    set(COMPILER_HAS_DEPRECATED "" CACHE INTERNAL "Compiler support for a deprecated attribute")
   else()
-    _check_cxx_compiler_attribute("__declspec(deprecated)" COMPILER_HAS_DEPRECATED)
+    _check_cxx_compiler_attribute("__attribute__((__deprecated__))" COMPILER_HAS_DEPRECATED_ATTR)
+    if(COMPILER_HAS_DEPRECATED_ATTR)
+      set(COMPILER_HAS_DEPRECATED "${COMPILER_HAS_DEPRECATED_ATTR}" CACHE INTERNAL "Compiler support for a deprecated attribute")
+    else()
+      _check_cxx_compiler_attribute("__declspec(deprecated)" COMPILER_HAS_DEPRECATED)
+    endif()
   endif()
 endmacro()
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c41c68bfa437d4ea1b2ae5153f6f20430c47d902
commit c41c68bfa437d4ea1b2ae5153f6f20430c47d902
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 13 23:06:01 2011 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 13 23:49:17 2011 +0200

    Try to error on deprecated on Intel and SunCC.

diff --git a/Tests/Module/GenerateExportHeader/CMakeLists.txt b/Tests/Module/GenerateExportHeader/CMakeLists.txt
index 46ab885..dc72689 100644
--- a/Tests/Module/GenerateExportHeader/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/CMakeLists.txt
@@ -20,6 +20,27 @@ endmacro()
 
 check_cxx_compiler_flag(-Werror HAS_WERROR_FLAG)
 
+if(HAS_WERROR_FLAG)
+  set(ERROR_FLAG "-Werror")
+else()
+  # MSVC
+  # And intel on windows?
+  # http://software.intel.com/en-us/articles/how-to-handle-warnings-message-in-compiler/?wapkw=%28compiler+warning+message%29
+  check_cxx_compiler_flag("/WX" HAS_WX_FLAG)
+  if(HAS_WX_FLAG)
+    set(ERROR_FLAG "/WX")
+  else()
+    # Sun CC
+    # http://www.acsu.buffalo.edu/~charngda/sunstudio.html
+    check_cxx_compiler_flag("-errwarn=%all" HAS_ERRWARN_ALL)
+    if (HAS_ERRWARN_ALL)
+      set(ERROR_FLAG "-errwarn=%all")
+    else()
+    endif()
+  endif()
+endif()
+
+
 # We seem to get race conditions is writing this stuff to the same file at least on MinGW
 # So to write to separate source and build directories, we use a count to differentiate.
 set (COUNT 0)
@@ -50,13 +71,8 @@ macro(_do_build Include Library LibrarySource Source)
 
     "add_compiler_export_flags()\n"
 
-    "if(${HAS_WERROR_FLAG})\n"
-    "  add_definitions(-Werror)\n"
-    "else()\n"
-    "  if(MSVC AND COMPILER_HAS_DEPRECATED)\n"
-         # Treat deprecation warnings as errors.
-    "    add_definitions(/we4996)\n"
-    "  endif()\n"
+    "if(NOT \"${ERROR_FLAG}\" STREQUAL \"\")\n"
+    "  add_definitions(${ERROR_FLAG})\n"
     "endif()\n"
 
     "if(MSVC)\n"

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aed84517c942a4c40f493fcf997cdf6a047349f8
commit aed84517c942a4c40f493fcf997cdf6a047349f8
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 13 22:33:30 2011 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 13 22:58:15 2011 +0200

    Test for deprecated attribute before declspec.
    
    The attribute seems more common, and some compilers seem to silently
    ignore the declspec.

diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake
index c833a01..044e2b4 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -158,11 +158,11 @@ macro(_test_compiler_hidden_visibility)
 endmacro()
 
 macro(_test_compiler_has_deprecated)
-  _check_cxx_compiler_attribute("__declspec(deprecated)" COMPILER_HAS_DEPRECATED_DECLSPEC)
-  if(COMPILER_HAS_DEPRECATED_DECLSPEC)
-    set(COMPILER_HAS_DEPRECATED "${COMPILER_HAS_DEPRECATED_DECLSPEC}" CACHE INTERNAL "Compiler support for a deprecated attribute")
+  _check_cxx_compiler_attribute("__attribute__((__deprecated__))" COMPILER_HAS_DEPRECATED_ATTR)
+  if(COMPILER_HAS_DEPRECATED_ATTR)
+    set(COMPILER_HAS_DEPRECATED "${COMPILER_HAS_DEPRECATED_ATTR}" CACHE INTERNAL "Compiler support for a deprecated attribute")
   else()
-    _check_cxx_compiler_attribute("__attribute__((__deprecated__))" COMPILER_HAS_DEPRECATED)
+    _check_cxx_compiler_attribute("__declspec(deprecated)" COMPILER_HAS_DEPRECATED)
   endif()
 endmacro()
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c448b09ad39c35b129d7b91710bea4f26fabdfe4
commit c448b09ad39c35b129d7b91710bea4f26fabdfe4
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 13 22:20:54 2011 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 13 22:57:55 2011 +0200

    Perform the -Werror test only once.
    
    This way, the output of the test should be visible on CDash.

diff --git a/Tests/Module/GenerateExportHeader/CMakeLists.txt b/Tests/Module/GenerateExportHeader/CMakeLists.txt
index a310eb9..46ab885 100644
--- a/Tests/Module/GenerateExportHeader/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/CMakeLists.txt
@@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR)
 
 project(GenerateExportHeader)
 
+include(CheckCXXCompilerFlag)
+
 set( CMAKE_INCLUDE_CURRENT_DIR ON )
 
 macro(TEST_FAIL value msg)
@@ -16,6 +18,8 @@ macro(TEST_PASS value msg)
   endif ()
 endmacro()
 
+check_cxx_compiler_flag(-Werror HAS_WERROR_FLAG)
+
 # We seem to get race conditions is writing this stuff to the same file at least on MinGW
 # So to write to separate source and build directories, we use a count to differentiate.
 set (COUNT 0)
@@ -46,9 +50,7 @@ macro(_do_build Include Library LibrarySource Source)
 
     "add_compiler_export_flags()\n"
 
-    "check_cxx_compiler_flag(-Werror HAS_WERROR_FLAG)\n"
-
-    "if(HAS_WERROR_FLAG)\n"
+    "if(${HAS_WERROR_FLAG})\n"
     "  add_definitions(-Werror)\n"
     "else()\n"
     "  if(MSVC AND COMPILER_HAS_DEPRECATED)\n"
@@ -101,6 +103,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
 message("#### COMPILER_HAS_DEPRECATED: " ${COMPILER_HAS_DEPRECATED})
 message("#### COMPILER_HAS_HIDDEN_VISIBILITY: " ${COMPILER_HAS_HIDDEN_VISIBILITY})
 message("#### WIN32: " ${WIN32})
+message("#### HAS_WERROR_FLAG: " ${HAS_WERROR_FLAG})
 
 set(link_libraries)
 macro(macro_add_test_library name)

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

Summary of changes:
 Modules/GenerateExportHeader.cmake               |   12 +++++--
 Tests/Module/GenerateExportHeader/CMakeLists.txt |   37 ++++++++++++++++-----
 2 files changed, 36 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list