[Cmake-commits] CMake branch, next, updated. v3.0.0-rc6-3607-g1d91bd7

Stephen Kelly steveire at gmail.com
Fri Jun 6 10:14:06 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  1d91bd76031ecc35f5697c38f9f97528f174410b (commit)
       via  3cbc0190e11b850c5cb051a3a0fda1349ccd2e22 (commit)
      from  8f277d560dacfc83f2bea3de9a7a8c839a21511b (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=1d91bd76031ecc35f5697c38f9f97528f174410b
commit 1d91bd76031ecc35f5697c38f9f97528f174410b
Merge: 8f277d5 3cbc019
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Jun 6 10:14:06 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Jun 6 10:14:06 2014 -0400

    Merge topic 'WriteCompilerDetectionHeader-compiler-versions' into next
    
    3cbc0190 Process hex version numbers appropriately.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3cbc0190e11b850c5cb051a3a0fda1349ccd2e22
commit 3cbc0190e11b850c5cb051a3a0fda1349ccd2e22
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Jun 6 16:11:24 2014 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Jun 6 16:11:54 2014 +0200

    Process hex version numbers appropriately.

diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake
index e5e5037..ed83674 100644
--- a/Modules/WriteCompilerDetectionHeader.cmake
+++ b/Modules/WriteCompilerDetectionHeader.cmake
@@ -212,11 +212,20 @@ function(write_compiler_detection_header
     GNU
     Clang
   )
+
+  set(_hex_compilers ADSP Borland Embarcadero SunPro)
+
   foreach(_comp ${_WCD_COMPILERS})
     list(FIND compilers ${_comp} idx)
     if (idx EQUAL -1)
       message(FATAL_ERROR "Unsupported compiler ${_comp}.")
     endif()
+    if (NOT _need_hex_conversion)
+      list(FIND _hex_compilers ${_comp} idx)
+      if (NOT idx EQUAL -1)
+        set(_need_hex_conversion TRUE)
+      endif()
+    endif()
   endforeach()
 
   set(file_content "
@@ -230,6 +239,21 @@ function(write_compiler_detection_header
     set(file_content "${file_content}\n${_WCD_PROLOG}\n")
   endif()
 
+  if (_need_hex_conversion)
+    set(file_content "${file_content}
+#define ${prefix_arg}_DEC(X) (X)
+#define ${prefix_arg}_HEX(X) ( \\
+    ((X)>>28 & 0xF) * 10000000 + \\
+    ((X)>>24 & 0xF) *  1000000 + \\
+    ((X)>>20 & 0xF) *   100000 + \\
+    ((X)>>16 & 0xF) *    10000 + \\
+    ((X)>>12 & 0xF) *     1000 + \\
+    ((X)>>8  & 0xF) *      100 + \\
+    ((X)>>4  & 0xF) *       10 + \\
+    ((X)     & 0xF) \\
+    )\n")
+  endif()
+
   foreach(feature ${_WCD_FEATURES})
     if (feature MATCHES "^cxx_")
       list(APPEND _langs CXX)
@@ -275,11 +299,18 @@ function(write_compiler_detection_header
 #    endif\n")
 
       set(PREFIX ${prefix_arg}_)
-      set(MACRO_DEC)
-      set(MACRO_HEX)
+      if (_need_hex_conversion)
+        set(MACRO_DEC ${prefix_arg}_DEC)
+        set(MACRO_HEX ${prefix_arg}_HEX)
+      else()
+        set(MACRO_DEC)
+        set(MACRO_HEX)
+      endif()
       string(CONFIGURE "${_compiler_id_version_compute_${compiler}}" VERSION_BLOCK @ONLY)
       set(file_content "${file_content}${VERSION_BLOCK}\n")
       set(PREFIX)
+      set(MACRO_DEC)
+      set(MACRO_HEX)
 
       set(pp_if "elif")
       foreach(feature ${${_lang}_features})

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

Summary of changes:
 Modules/WriteCompilerDetectionHeader.cmake |   35 ++++++++++++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list