diff options
author | Brad King <brad.king@kitware.com> | 2017-08-24 13:32:46 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-08-24 13:33:24 (GMT) |
commit | 061b4f24be8281a1504f6993602d79b61b862d6d (patch) | |
tree | e640f8091ed8bd631762d7a43756b916a795b4fb | |
parent | fe19fda2aa2595622c463fccaa8b36a91e4521c4 (diff) | |
parent | 6756b552eedbe3f2185e02638701c11cd5799b86 (diff) | |
download | CMake-061b4f24be8281a1504f6993602d79b61b862d6d.zip CMake-061b4f24be8281a1504f6993602d79b61b862d6d.tar.gz CMake-061b4f24be8281a1504f6993602d79b61b862d6d.tar.bz2 |
Merge topic 'ipo-test-output'
6756b552 Tests: Print more info on CheckIPOSupported test failure
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1177
-rw-r--r-- | Tests/Module/CheckIPOSupported-C/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Tests/Module/CheckIPOSupported-Fortran/CMakeLists.txt | 5 |
3 files changed, 9 insertions, 6 deletions
diff --git a/Tests/Module/CheckIPOSupported-C/CMakeLists.txt b/Tests/Module/CheckIPOSupported-C/CMakeLists.txt index 607dcd3..4a41a98 100644 --- a/Tests/Module/CheckIPOSupported-C/CMakeLists.txt +++ b/Tests/Module/CheckIPOSupported-C/CMakeLists.txt @@ -4,11 +4,12 @@ project(CheckIPOSupported-C LANGUAGES C) cmake_policy(SET CMP0069 NEW) include(CheckIPOSupported) -check_ipo_supported(RESULT ipo_supported) +check_ipo_supported(RESULT ipo_supported OUTPUT ipo_output) if(ipo_supported) set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) elseif(CMake_TEST_IPO_WORKS_C) - message(FATAL_ERROR "IPO expected to work") + string(REPLACE "\n" "\n " ipo_output "${ipo_output}") + message(FATAL_ERROR "IPO expected to work, but the check failed:\n ${ipo_output}") endif() add_library(foo foo.c) diff --git a/Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt b/Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt index 2dede93..1bb2b84 100644 --- a/Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt +++ b/Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt @@ -4,11 +4,12 @@ project(CheckIPOSupported-CXX LANGUAGES CXX) cmake_policy(SET CMP0069 NEW) include(CheckIPOSupported) -check_ipo_supported(RESULT ipo_supported) +check_ipo_supported(RESULT ipo_supported OUTPUT ipo_output) if(ipo_supported) set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) elseif(CMake_TEST_IPO_WORKS_CXX) - message(FATAL_ERROR "IPO expected to work") + string(REPLACE "\n" "\n " ipo_output "${ipo_output}") + message(FATAL_ERROR "IPO expected to work, but the check failed:\n ${ipo_output}") endif() add_library(foo foo.cpp) diff --git a/Tests/Module/CheckIPOSupported-Fortran/CMakeLists.txt b/Tests/Module/CheckIPOSupported-Fortran/CMakeLists.txt index dee5c25..3872b56 100644 --- a/Tests/Module/CheckIPOSupported-Fortran/CMakeLists.txt +++ b/Tests/Module/CheckIPOSupported-Fortran/CMakeLists.txt @@ -4,11 +4,12 @@ project(CheckIPOSupported-Fortran LANGUAGES Fortran) cmake_policy(SET CMP0069 NEW) include(CheckIPOSupported) -check_ipo_supported(RESULT ipo_supported) +check_ipo_supported(RESULT ipo_supported OUTPUT ipo_output) if(ipo_supported) set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) elseif(CMake_TEST_IPO_WORKS_Fortran) - message(FATAL_ERROR "IPO expected to work") + string(REPLACE "\n" "\n " ipo_output "${ipo_output}") + message(FATAL_ERROR "IPO expected to work, but the check failed:\n ${ipo_output}") endif() add_library(foo foo.f) |