[Cmake-commits] CMake branch, next, updated. v3.0.0-rc3-1958-g022179d

Stephen Kelly steveire at gmail.com
Sun Apr 6 06:25:48 EDT 2014


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  022179d0c0a5d0386e08b16cf044e298036ebe67 (commit)
       via  35cebcdd563844a1a6bf176d44f7f74e55196d77 (commit)
      from  acb508bcf8a015c4b78ad2690ed6cb2cd60c396a (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=022179d0c0a5d0386e08b16cf044e298036ebe67
commit 022179d0c0a5d0386e08b16cf044e298036ebe67
Merge: acb508b 35cebcd
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 06:25:47 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Apr 6 06:25:47 2014 -0400

    Merge topic 'gnu-cxx-features' into next
    
    35cebcdd Features: Add gnu_cxx_typeof extension.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=35cebcdd563844a1a6bf176d44f7f74e55196d77
commit 35cebcdd563844a1a6bf176d44f7f74e55196d77
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 12:13:10 2014 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Apr 6 12:13:10 2014 +0200

    Features: Add gnu_cxx_typeof extension.
    
    Add infrastructure for recording C++ compiler extensions as
    needed.

diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
index 222a3c8..a6927fd 100644
--- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -233,3 +233,8 @@ The features known to this version of CMake are:
 
 ``cxx_template_template_parameters``
   Template template parameters, as defined in ``ISO/IEC 14882:1998``.
+
+``gnu_cxx_typeof``
+  The GNU typeof extension, as defined in the `GNU Typeof Documentation`_.
+
+.. _`GNU Typeof Documentation`: http://gcc.gnu.org/onlinedocs/gcc/Typeof.html#Typeof
diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in
index 6e531ca..0e0b0b7 100644
--- a/Modules/CMakeCXXCompiler.cmake.in
+++ b/Modules/CMakeCXXCompiler.cmake.in
@@ -4,6 +4,7 @@ set(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@")
 set(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@")
 set(CMAKE_CXX_COMPILE_FEATURES "@CMAKE_CXX_COMPILE_FEATURES@")
 set(CMAKE_CXX98_COMPILE_FEATURES "@CMAKE_CXX98_COMPILE_FEATURES@")
+set(CMAKE_CXX98_COMPILE_EXTENSIONS "@CMAKE_CXX98_COMPILE_EXTENSIONS@")
 set(CMAKE_CXX11_COMPILE_FEATURES "@CMAKE_CXX11_COMPILE_FEATURES@")
 
 set(CMAKE_CXX_PLATFORM_ID "@CMAKE_CXX_PLATFORM_ID@")
diff --git a/Modules/CMakeDetermineCompileFeatures.cmake b/Modules/CMakeDetermineCompileFeatures.cmake
index 583ff8d..5237a04 100644
--- a/Modules/CMakeDetermineCompileFeatures.cmake
+++ b/Modules/CMakeDetermineCompileFeatures.cmake
@@ -18,6 +18,7 @@ function(cmake_determine_compile_features lang)
     message(STATUS "Detecting ${lang} compile features")
 
     set(CMAKE_CXX98_COMPILE_FEATURES)
+    set(CMAKE_CXX98_COMPILE_EXTENSIONS)
     set(CMAKE_CXX11_COMPILE_FEATURES)
 
     include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake")
@@ -29,19 +30,24 @@ function(cmake_determine_compile_features lang)
       return()
     endif()
 
-    if (CMAKE_CXX98_COMPILE_FEATURES)
+    if (CMAKE_CXX98_COMPILE_EXTENSIONS)
+      list(REMOVE_ITEM CMAKE_CXX11_COMPILE_FEATURES ${CMAKE_CXX98_COMPILE_EXTENSIONS})
+      list(REMOVE_ITEM CMAKE_CXX98_COMPILE_EXTENSIONS ${CMAKE_CXX98_COMPILE_FEATURES})
+    elseif(CMAKE_CXX98_COMPILE_FEATURES)
       list(REMOVE_ITEM CMAKE_CXX11_COMPILE_FEATURES ${CMAKE_CXX98_COMPILE_FEATURES})
     endif()
 
     if(NOT CMAKE_CXX_COMPILE_FEATURES)
       set(CMAKE_CXX_COMPILE_FEATURES
         ${CMAKE_CXX98_COMPILE_FEATURES}
+        ${CMAKE_CXX98_COMPILE_EXTENSIONS}
         ${CMAKE_CXX11_COMPILE_FEATURES}
       )
     endif()
 
     set(CMAKE_CXX_COMPILE_FEATURES ${CMAKE_CXX_COMPILE_FEATURES} PARENT_SCOPE)
     set(CMAKE_CXX98_COMPILE_FEATURES ${CMAKE_CXX98_COMPILE_FEATURES} PARENT_SCOPE)
+    set(CMAKE_CXX98_COMPILE_EXTENSIONS ${CMAKE_CXX98_COMPILE_EXTENSIONS} PARENT_SCOPE)
     set(CMAKE_CXX11_COMPILE_FEATURES ${CMAKE_CXX11_COMPILE_FEATURES} PARENT_SCOPE)
 
     message(STATUS "Detecting ${lang} compile features - done")
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index e5fec8c..fd580e2 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -77,4 +77,5 @@ set(_cmake_feature_test_cxx_extern_templates "${_oldestSupported} && __cplusplus
 set(_cmake_feature_test_cxx_variadic_macros "${_oldestSupported} && __cplusplus >= 201103L")
 set(_cmake_feature_test_cxx_func_identifier "${_oldestSupported} && __cplusplus >= 201103L")
 set(_cmake_feature_test_cxx_template_template_parameters "${_oldestSupported} && __cplusplus >= 199711L")
+set(_cmake_feature_test_gnu_cxx_typeof "${_oldestSupported} && !defined(__STRICT_ANSI__)")
 set(_oldestSupported)
diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake
index 59d589a..b08b3ae 100644
--- a/Modules/Compiler/GNU-CXX.cmake
+++ b/Modules/Compiler/GNU-CXX.cmake
@@ -32,6 +32,7 @@ macro(cmake_record_cxx_compile_features)
   if (UNIX AND NOT APPLE AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
     _get_gcc_features(c++11 CMAKE_CXX11_COMPILE_FEATURES)
     _get_gcc_features(c++98 CMAKE_CXX98_COMPILE_FEATURES)
+    _get_gcc_features(gnu++98 CMAKE_CXX98_COMPILE_EXTENSIONS)
   else()
     set(_result 0)
   endif()
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index e3a3f07..e867f96 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -86,7 +86,8 @@
   F(cxx_local_type_template_args) \
   F(cxx_func_identifier) \
   F(cxx_long_long_type) \
-  F(cxx_template_template_parameters)
+  F(cxx_template_template_parameters) \
+  F(gnu_cxx_typeof)
 
 class cmMakefile::Internals
 {
@@ -4629,6 +4630,7 @@ AddRequiredTargetFeature(cmTarget *target, const std::string& feature,
 
   bool needCxx98 = false;
   bool needCxx11 = false;
+  bool needCxxExt = false;
 
   if (const char *propCxx98 =
           this->GetDefinition("CMAKE_CXX98_COMPILE_FEATURES"))
@@ -4645,6 +4647,14 @@ AddRequiredTargetFeature(cmTarget *target, const std::string& feature,
     needCxx11 = std::find(props.begin(), props.end(), feature) != props.end();
     }
 
+  if (const char *propCxx98ext =
+          this->GetDefinition("CMAKE_CXX98_COMPILE_EXTENSIONS"))
+    {
+    std::vector<std::string> props;
+    cmSystemTools::ExpandListArgument(propCxx98ext, props);
+    needCxxExt = std::find(props.begin(), props.end(), feature) != props.end();
+    }
+
   const char *existingCxxStandard = target->GetProperty("CXX_STANDARD");
   if (existingCxxStandard)
     {
@@ -4690,5 +4700,14 @@ AddRequiredTargetFeature(cmTarget *target, const std::string& feature,
     {
     target->SetProperty("CXX_STANDARD", "98");
     }
+  bool existingCxxExt = target->GetPropertyAsBool("CXX_EXTENSIONS");
+  if (needCxxExt && !existingCxxExt)
+    {
+    target->SetProperty("CXX_EXTENSIONS", "1");
+    if (!target->GetProperty("CXX_STANDARD"))
+      {
+      target->SetProperty("CXX_STANDARD", "98");
+      }
+    }
   return true;
 }
diff --git a/Tests/CompileFeatures/gnu_cxx_typeof.cpp b/Tests/CompileFeatures/gnu_cxx_typeof.cpp
new file mode 100644
index 0000000..2290aff
--- /dev/null
+++ b/Tests/CompileFeatures/gnu_cxx_typeof.cpp
@@ -0,0 +1,6 @@
+
+int someFunc(int arg)
+{
+  typeof(arg) retValue = 0;
+  return retValue;
+}
diff --git a/Tests/SystemInformation/SystemInformation.in b/Tests/SystemInformation/SystemInformation.in
index 9966e8d..4addc1f 100644
--- a/Tests/SystemInformation/SystemInformation.in
+++ b/Tests/SystemInformation/SystemInformation.in
@@ -27,6 +27,7 @@ CMAKE_CXX98_EXTENSION_COMPILE_OPTION == "${CMAKE_CXX98_EXTENSION_COMPILE_OPTION}
 CMAKE_CXX11_EXTENSION_COMPILE_OPTION == "${CMAKE_CXX11_EXTENSION_COMPILE_OPTION}"
 CMAKE_CXX_COMPILE_FEATURES == "${CMAKE_CXX_COMPILE_FEATURES}"
 CMAKE_CXX98_COMPILE_FEATURES == "${CMAKE_CXX98_COMPILE_FEATURES}"
+CMAKE_CXX98_COMPILE_EXTENSIONS == "${CMAKE_CXX98_COMPILE_EXTENSIONS}"
 CMAKE_CXX11_COMPILE_FEATURES == "${CMAKE_CXX11_COMPILE_FEATURES}"
 
 // C shared library flag

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

Summary of changes:
 Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst   |    5 +++++
 Modules/CMakeCXXCompiler.cmake.in            |    1 +
 Modules/CMakeDetermineCompileFeatures.cmake  |    8 +++++++-
 Modules/Compiler/GNU-CXX-FeatureTests.cmake  |    1 +
 Modules/Compiler/GNU-CXX.cmake               |    1 +
 Source/cmMakefile.cxx                        |   21 ++++++++++++++++++++-
 Tests/CompileFeatures/gnu_cxx_typeof.cpp     |    6 ++++++
 Tests/SystemInformation/SystemInformation.in |    1 +
 8 files changed, 42 insertions(+), 2 deletions(-)
 create mode 100644 Tests/CompileFeatures/gnu_cxx_typeof.cpp


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list