diff options
author | Brad King <brad.king@kitware.com> | 2017-08-23 12:30:32 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-08-23 12:43:28 (GMT) |
commit | 6756b552eedbe3f2185e02638701c11cd5799b86 (patch) | |
tree | 64525903d40ee114f08d2a00bbd63fe0465fce5c /Tests/Module | |
parent | ac6660b6716f14815bdd0f75cf1da4cf3ad7381c (diff) | |
download | CMake-6756b552eedbe3f2185e02638701c11cd5799b86.zip CMake-6756b552eedbe3f2185e02638701c11cd5799b86.tar.gz CMake-6756b552eedbe3f2185e02638701c11cd5799b86.tar.bz2 |
Tests: Print more info on CheckIPOSupported test failure
Diffstat (limited to 'Tests/Module')
-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) |