[Cmake-commits] CMake branch, next, updated. v2.8.11.2-3195-gde805a1

Brad King brad.king at kitware.com
Wed Jul 17 15:44:49 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  de805a17a031fcbc10454ac1fb029e606d48bce8 (commit)
       via  4dc4018553856fb2dae47ea608b8a09221b155fa (commit)
      from  53ee3f6e18679a6477390e1acd94d2c52c122d1f (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=de805a17a031fcbc10454ac1fb029e606d48bce8
commit de805a17a031fcbc10454ac1fb029e606d48bce8
Merge: 53ee3f6 4dc4018
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jul 17 15:44:46 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Jul 17 15:44:46 2013 -0400

    Merge topic 'abi-check-tolerate-COPY_FILE-failure' into next
    
    4dc4018 Teach compiler ABI check to tolerate try_compile COPY_FILE failure


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4dc4018553856fb2dae47ea608b8a09221b155fa
commit 4dc4018553856fb2dae47ea608b8a09221b155fa
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jul 17 14:56:40 2013 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jul 17 15:40:44 2013 -0400

    Teach compiler ABI check to tolerate try_compile COPY_FILE failure
    
    In CMakeDetermineCompilerABI we use try_compile with the COPY_FILE
    option to get a copy of the compiled binary used to detect the ABI
    information.  We already tolerate the case when compilation fails.
    However, when compilation appears to succeed but does not produce the
    expected executable the try_compile command immediately reports an error
    because the COPY_FILE fails.
    
    Tolerate COPY_FILE failure without stopping the overall configuration
    process by using the try_compile COPY_FILE_ERROR option to capture the
    error message.  Log the full error to CMakeError.log and simply report
    failure to detect the ABI as if compilation had failed.
    
    Teach the RunCMake.Configure test to cover this case and verify that the
    messages show up as expected both in stdout and in CMakeError.log.

diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
index 44cc04a..e9ae995 100644
--- a/Modules/CMakeDetermineCompilerABI.cmake
+++ b/Modules/CMakeDetermineCompilerABI.cmake
@@ -41,6 +41,7 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
                   "--no-warn-unused-cli"
       OUTPUT_VARIABLE OUTPUT
       COPY_FILE "${BIN}"
+      COPY_FILE_ERROR _copy_error
       )
     # Move result from cache to normal variable.
     set(CMAKE_${lang}_ABI_COMPILED ${CMAKE_${lang}_ABI_COMPILED})
@@ -48,7 +49,7 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
     set(CMAKE_${lang}_ABI_COMPILED ${CMAKE_${lang}_ABI_COMPILED} PARENT_SCOPE)
 
     # Load the resulting information strings.
-    if(CMAKE_${lang}_ABI_COMPILED)
+    if(CMAKE_${lang}_ABI_COMPILED AND NOT _copy_error)
       message(STATUS "Detecting ${lang} compiler ABI info - done")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Detecting ${lang} compiler ABI info compiled with the following output:\n${OUTPUT}\n\n")
@@ -131,7 +132,7 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
     else()
       message(STATUS "Detecting ${lang} compiler ABI info - failed")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
-        "Detecting ${lang} compiler ABI info failed to compile with the following output:\n${OUTPUT}\n\n")
+        "Detecting ${lang} compiler ABI info failed to compile with the following output:\n${OUTPUT}\n${_copy_error}\n\n")
     endif()
   endif()
 endfunction()
diff --git a/Tests/RunCMake/Configure/FailCopyFileABI-check.cmake b/Tests/RunCMake/Configure/FailCopyFileABI-check.cmake
new file mode 100644
index 0000000..c439aac
--- /dev/null
+++ b/Tests/RunCMake/Configure/FailCopyFileABI-check.cmake
@@ -0,0 +1,13 @@
+set(log "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/CMakeError.log")
+if(EXISTS "${log}")
+  file(READ "${log}" error_log)
+else()
+  set(error_log "")
+endif()
+if(NOT error_log MATCHES "Cannot copy output executable.*
+to destination specified by COPY_FILE:.*
+Unable to find the executable at any of:
+  .*\\.missing")
+  string(REGEX REPLACE "\n" "\n  " error_log "  ${error_log}")
+  set(RunCMake_TEST_FAILED "Log file:\n ${log}\ndoes not have expected COPY_FILE failure message:\n${error_log}")
+endif()
diff --git a/Tests/RunCMake/Configure/FailCopyFileABI-override.cmake b/Tests/RunCMake/Configure/FailCopyFileABI-override.cmake
new file mode 100644
index 0000000..c633555
--- /dev/null
+++ b/Tests/RunCMake/Configure/FailCopyFileABI-override.cmake
@@ -0,0 +1,6 @@
+# Change the executable suffix that try_compile will use for
+# COPY_FILE but not inside the test project.  This forces failure.
+get_property(in_try_compile GLOBAL PROPERTY IN_TRY_COMPILE)
+if(NOT in_try_compile)
+  set(CMAKE_EXECUTABLE_SUFFIX .missing)
+endif()
diff --git a/Tests/RunCMake/Configure/FailCopyFileABI-stdout.txt b/Tests/RunCMake/Configure/FailCopyFileABI-stdout.txt
new file mode 100644
index 0000000..bb87f4c
--- /dev/null
+++ b/Tests/RunCMake/Configure/FailCopyFileABI-stdout.txt
@@ -0,0 +1,4 @@
+-- Detecting C compiler ABI info
+-- Detecting C compiler ABI info - failed
+-- Configuring done
+-- Generating done
diff --git a/Tests/RunCMake/Configure/FailCopyFileABI.cmake b/Tests/RunCMake/Configure/FailCopyFileABI.cmake
new file mode 100644
index 0000000..74efd97
--- /dev/null
+++ b/Tests/RunCMake/Configure/FailCopyFileABI.cmake
@@ -0,0 +1,2 @@
+set(CMAKE_USER_MAKE_RULES_OVERRIDE_C ${CMAKE_CURRENT_SOURCE_DIR}/FailCopyFileABI-override.cmake)
+enable_language(C)
diff --git a/Tests/RunCMake/Configure/RunCMakeTest.cmake b/Tests/RunCMake/Configure/RunCMakeTest.cmake
index 46f9184..79e4060 100644
--- a/Tests/RunCMake/Configure/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Configure/RunCMakeTest.cmake
@@ -1,3 +1,4 @@
 include(RunCMake)
 
 run_cmake(ErrorLogs)
+run_cmake(FailCopyFileABI)

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

Summary of changes:
 Modules/CMakeDetermineCompilerABI.cmake            |    5 +++--
 .../RunCMake/Configure/FailCopyFileABI-check.cmake |   13 +++++++++++++
 .../Configure/FailCopyFileABI-override.cmake       |    6 ++++++
 .../RunCMake/Configure/FailCopyFileABI-stdout.txt  |    4 ++++
 Tests/RunCMake/Configure/FailCopyFileABI.cmake     |    2 ++
 Tests/RunCMake/Configure/RunCMakeTest.cmake        |    1 +
 6 files changed, 29 insertions(+), 2 deletions(-)
 create mode 100644 Tests/RunCMake/Configure/FailCopyFileABI-check.cmake
 create mode 100644 Tests/RunCMake/Configure/FailCopyFileABI-override.cmake
 create mode 100644 Tests/RunCMake/Configure/FailCopyFileABI-stdout.txt
 create mode 100644 Tests/RunCMake/Configure/FailCopyFileABI.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list