[Cmake-commits] CMake branch, next, updated. v2.8.11.2-3839-g74436a6

Rolf Eike Beer eike at sf-mail.de
Sat Aug 10 15:30:28 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  74436a6c3da9c19019bfc170299f62fd6da827b9 (commit)
       via  f0091298ce6b7e087dd605f48288132ccb0117a9 (commit)
      from  4a28dd0c7054e31377755437f5d396633029fe2a (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=74436a6c3da9c19019bfc170299f62fd6da827b9
commit 74436a6c3da9c19019bfc170299f62fd6da827b9
Merge: 4a28dd0 f009129
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Sat Aug 10 15:30:27 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Aug 10 15:30:27 2013 -0400

    Merge topic 'cxx-flags' into next
    
    f009129 Check*CompilerFlag: make C and CXX modules share most error patterns


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f0091298ce6b7e087dd605f48288132ccb0117a9
commit f0091298ce6b7e087dd605f48288132ccb0117a9
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Fri Aug 9 21:50:37 2013 +0200
Commit:     Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Sat Aug 10 21:29:19 2013 +0200

    Check*CompilerFlag: make C and CXX modules share most error patterns
    
    This simplifies maintenance as most patterns will be for both modules and may
    be added at a central place.

diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake
index 2213acc..842e824 100644
--- a/Modules/CheckCCompilerFlag.cmake
+++ b/Modules/CheckCCompilerFlag.cmake
@@ -22,37 +22,50 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-include(CheckCSourceCompiles)
+include(${CMAKE_CURRENT_LIST_DIR}/CheckCSourceCompiles.cmake)
+
+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 ()
 
 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 5e08aaf..5e221e6 100644
--- a/Modules/CheckCXXCompilerFlag.cmake
+++ b/Modules/CheckCXXCompilerFlag.cmake
@@ -22,7 +22,15 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-include(CheckCXXSourceCompiles)
+include(${CMAKE_CURRENT_LIST_DIR}/CheckCXXSourceCompiles.cmake)
+
+# This is a function to have the include in a scope to force people to
+# explicitely include CheckCCompilerFlag if they need it.
+function (CHECK_CXX_COMPILER_FLAG_COMMON_PATTERNS _VAR)
+   include(${CMAKE_CURRENT_LIST_DIR}/CheckCCompilerFlag.cmake)
+   CHECK_COMPILER_FLAG_COMMON_PATTERNS(${_VAR})
+   set(${_VAR} ${${_VAR}} PARENT_SCOPE)
+endfunction ()
 
 macro (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
    set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
@@ -34,30 +42,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_CXX_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 "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
+     ${_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:
 Modules/CheckCCompilerFlag.cmake   |   37 ++++++++++++++++++++++++-----------
 Modules/CheckCXXCompilerFlag.cmake |   30 ++++++++++++----------------
 2 files changed, 38 insertions(+), 29 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list