[Cmake-commits] CMake branch, next, updated. v2.8.11.2-3867-g6a7367d

Rolf Eike Beer eike at sf-mail.de
Tue Aug 13 17:27:14 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  6a7367dc1ab8686e080eb990eff887a41b568042 (commit)
       via  6f3ebfed983df5f171a2009360fea02e6efbfb56 (commit)
      from  a0486eaf2f877fa9c178688bd46d814af1b07742 (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=6a7367dc1ab8686e080eb990eff887a41b568042
commit 6a7367dc1ab8686e080eb990eff887a41b568042
Merge: a0486ea 6f3ebfe
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Tue Aug 13 17:27:12 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Aug 13 17:27:12 2013 -0400

    Merge topic 'cxx-flags' into next
    
    6f3ebfe Check*CompilerFlag: make C and CXX modules share most error patterns (#14339)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6f3ebfed983df5f171a2009360fea02e6efbfb56
commit 6f3ebfed983df5f171a2009360fea02e6efbfb56
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Thu Aug 8 23:13:52 2013 +0200
Commit:     Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Tue Aug 13 23:27:10 2013 +0200

    Check*CompilerFlag: make C and CXX modules share most error patterns (#14339)
    
    This simplifies maintenance as most patterns will be for both modules and may
    be added at a central place.
    
    While at it add error patterns for XL and BCC.

diff --git a/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake b/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake
new file mode 100644
index 0000000..abe1ec5
--- /dev/null
+++ b/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake
@@ -0,0 +1,40 @@
+
+#=============================================================================
+# Copyright 2006-2011 Kitware, Inc.
+# Copyright 2006 Alexander Neundorf <neundorf at kde.org>
+# Copyright 2011 Matthias Kretz <kretz at kde.org>
+# Copyright 2013 Rolf Eike Beer <eike at sf-mail.de>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+# Do NOT include this module directly into any of your code. It is meant as
+# a library for Check*CompilerFlag.cmake modules. It's content may change in
+# any way between releases.
+
+macro (CHECK_COMPILER_FLAG_COMMON_PATTERNS _VAR)
+   set(${_VAR}
+     FAIL_REGEX "unrecognized .*option"                     # GNU
+     FAIL_REGEX "unknown .*option"                          # Clang
+     FAIL_REGEX "ignoring unknown option"                   # MSVC
+     FAIL_REGEX "warning D9002"                             # MSVC, any lang
+     FAIL_REGEX "option.*not supported"                     # Intel
+     FAIL_REGEX "invalid argument .*option"                 # Intel
+     FAIL_REGEX "ignoring option .*argument required"       # Intel
+     FAIL_REGEX "[Uu]nknown option"                         # HP
+     FAIL_REGEX "[Ww]arning: [Oo]ption"                     # SunPro
+     FAIL_REGEX "command option .* is not recognized"       # XL
+     FAIL_REGEX "command option .* contains an incorrect subargument" # XL
+     FAIL_REGEX "not supported in this configuration; ignored"       # AIX
+     FAIL_REGEX "File with unknown suffix passed to linker" # PGI
+     FAIL_REGEX "WARNING: unknown flag:"                    # Open64
+     FAIL_REGEX "Incorrect command line option:"            # Borland
+   )
+endmacro ()
diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake
index bc15e9a..dab5710 100644
--- a/Modules/CheckCCompilerFlag.cmake
+++ b/Modules/CheckCCompilerFlag.cmake
@@ -26,36 +26,30 @@
 #  License text for the above reference.)
 
 include(CheckCSourceCompiles)
+include(CMakeCheckCompilerFlagCommonPatterns)
 
 macro (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
    set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
    set(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
+
    # Normalize locale during test compilation.
    set(_CheckCCompilerFlag_LOCALE_VARS LC_ALL LC_MESSAGES LANG)
    foreach(v ${_CheckCCompilerFlag_LOCALE_VARS})
      set(_CheckCCompilerFlag_SAVED_${v} "$ENV{${v}}")
      set(ENV{${v}} C)
    endforeach()
+   CHECK_COMPILER_FLAG_COMMON_PATTERNS(_CheckCCompilerFlag_COMMON_PATTERNS)
    CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${_RESULT}
      # Some compilers do not fail with a bad flag
      FAIL_REGEX "command line option .* is valid for .* but not for C" # GNU
-     FAIL_REGEX "unrecognized .*option"                     # GNU
-     FAIL_REGEX "unknown .*option"                          # Clang
-     FAIL_REGEX "ignoring unknown option"                   # MSVC
-     FAIL_REGEX "warning D9002"                             # MSVC, any lang
-     FAIL_REGEX "option.*not supported"                     # Intel
-     FAIL_REGEX "invalid argument .*option"                 # Intel
-     FAIL_REGEX "ignoring option .*argument required"       # Intel
-     FAIL_REGEX "[Uu]nknown option"                         # HP
-     FAIL_REGEX "[Ww]arning: [Oo]ption"                     # SunPro
-     FAIL_REGEX "command option .* is not recognized"       # XL
-     FAIL_REGEX "WARNING: unknown flag:"                    # Open64
+     ${_CheckCCompilerFlag_COMMON_PATTERNS}
      )
    foreach(v ${_CheckCCompilerFlag_LOCALE_VARS})
      set(ENV{${v}} ${_CheckCCompilerFlag_SAVED_${v}})
      unset(_CheckCCompilerFlag_SAVED_${v})
    endforeach()
    unset(_CheckCCompilerFlag_LOCALE_VARS)
+   unset(_CheckCCompilerFlag_COMMON_PATTERNS)
 
    set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
 endmacro ()
diff --git a/Modules/CheckCXXCompilerFlag.cmake b/Modules/CheckCXXCompilerFlag.cmake
index eee3a70..4435a1f 100644
--- a/Modules/CheckCXXCompilerFlag.cmake
+++ b/Modules/CheckCXXCompilerFlag.cmake
@@ -26,6 +26,7 @@
 #  License text for the above reference.)
 
 include(CheckCXXSourceCompiles)
+include(CMakeCheckCompilerFlagCommonPatterns)
 
 macro (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
    set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
@@ -37,28 +38,18 @@ macro (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
      set(_CheckCXXCompilerFlag_SAVED_${v} "$ENV{${v}}")
      set(ENV{${v}} C)
    endforeach()
-   CHECK_CXX_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT}
+   CHECK_COMPILER_FLAG_COMMON_PATTERNS(_CheckCXXCompilerFlag_COMMON_PATTERNS)
+   CHECK_CXX_SOURCE_COMPILES("int main() { return 0; }" ${_RESULT}
      # Some compilers do not fail with a bad flag
      FAIL_REGEX "command line option .* is valid for .* but not for C\\\\+\\\\+" # GNU
-     FAIL_REGEX "unrecognized .*option"                     # GNU
-     FAIL_REGEX "unknown .*option"                          # Clang
-     FAIL_REGEX "ignoring unknown option"                   # MSVC
-     FAIL_REGEX "warning D9002"                             # MSVC, any lang
-     FAIL_REGEX "option.*not supported"                     # Intel
-     FAIL_REGEX "invalid argument .*option"                 # Intel
-     FAIL_REGEX "ignoring option .*argument required"       # Intel
-     FAIL_REGEX "[Uu]nknown option"                         # HP
-     FAIL_REGEX "[Ww]arning: [Oo]ption"                     # SunPro
-     FAIL_REGEX "command option .* is not recognized"       # XL
-     FAIL_REGEX "not supported in this configuration; ignored"       # AIX
-     FAIL_REGEX "File with unknown suffix passed to linker" # PGI
-     FAIL_REGEX "WARNING: unknown flag:"                    # Open64
+     ${_CheckCXXCompilerFlag_COMMON_PATTERNS}
      )
    foreach(v ${_CheckCXXCompilerFlag_LOCALE_VARS})
      set(ENV{${v}} ${_CheckCXXCompilerFlag_SAVED_${v}})
      unset(_CheckCXXCompilerFlag_SAVED_${v})
    endforeach()
    unset(_CheckCXXCompilerFlag_LOCALE_VARS)
+   unset(_CheckCXXCompilerFlag_COMMON_PATTERNS)
 
    set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
 endmacro ()

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list