summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-08-24 13:32:46 +0000
committerKitware Robot <kwrobot@kitware.com>2017-08-24 09:33:24 -0400
commit061b4f24be8281a1504f6993602d79b61b862d6d (patch)
treee640f8091ed8bd631762d7a43756b916a795b4fb /Tests
parentfe19fda2aa2595622c463fccaa8b36a91e4521c4 (diff)
parent6756b552eedbe3f2185e02638701c11cd5799b86 (diff)
downloadcmake-061b4f24be8281a1504f6993602d79b61b862d6d.tar.gz
Merge topic 'ipo-test-output'
6756b552 Tests: Print more info on CheckIPOSupported test failure Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1177
Diffstat (limited to 'Tests')
-rw-r--r--Tests/Module/CheckIPOSupported-C/CMakeLists.txt5
-rw-r--r--Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt5
-rw-r--r--Tests/Module/CheckIPOSupported-Fortran/CMakeLists.txt5
3 files changed, 9 insertions, 6 deletions
diff --git a/Tests/Module/CheckIPOSupported-C/CMakeLists.txt b/Tests/Module/CheckIPOSupported-C/CMakeLists.txt
index 607dcd33ae..4a41a988d9 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 2dede930b5..1bb2b8496d 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 dee5c25bd1..3872b567b6 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)