mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-12 17:19:05 -05:00
Tests: Print more info on CheckIPOSupported test failure
This commit is contained in:
@@ -4,11 +4,12 @@ project(CheckIPOSupported-C LANGUAGES C)
|
|||||||
cmake_policy(SET CMP0069 NEW)
|
cmake_policy(SET CMP0069 NEW)
|
||||||
|
|
||||||
include(CheckIPOSupported)
|
include(CheckIPOSupported)
|
||||||
check_ipo_supported(RESULT ipo_supported)
|
check_ipo_supported(RESULT ipo_supported OUTPUT ipo_output)
|
||||||
if(ipo_supported)
|
if(ipo_supported)
|
||||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
||||||
elseif(CMake_TEST_IPO_WORKS_C)
|
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()
|
endif()
|
||||||
|
|
||||||
add_library(foo foo.c)
|
add_library(foo foo.c)
|
||||||
|
|||||||
@@ -4,11 +4,12 @@ project(CheckIPOSupported-CXX LANGUAGES CXX)
|
|||||||
cmake_policy(SET CMP0069 NEW)
|
cmake_policy(SET CMP0069 NEW)
|
||||||
|
|
||||||
include(CheckIPOSupported)
|
include(CheckIPOSupported)
|
||||||
check_ipo_supported(RESULT ipo_supported)
|
check_ipo_supported(RESULT ipo_supported OUTPUT ipo_output)
|
||||||
if(ipo_supported)
|
if(ipo_supported)
|
||||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
||||||
elseif(CMake_TEST_IPO_WORKS_CXX)
|
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()
|
endif()
|
||||||
|
|
||||||
add_library(foo foo.cpp)
|
add_library(foo foo.cpp)
|
||||||
|
|||||||
@@ -4,11 +4,12 @@ project(CheckIPOSupported-Fortran LANGUAGES Fortran)
|
|||||||
cmake_policy(SET CMP0069 NEW)
|
cmake_policy(SET CMP0069 NEW)
|
||||||
|
|
||||||
include(CheckIPOSupported)
|
include(CheckIPOSupported)
|
||||||
check_ipo_supported(RESULT ipo_supported)
|
check_ipo_supported(RESULT ipo_supported OUTPUT ipo_output)
|
||||||
if(ipo_supported)
|
if(ipo_supported)
|
||||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
||||||
elseif(CMake_TEST_IPO_WORKS_Fortran)
|
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()
|
endif()
|
||||||
|
|
||||||
add_library(foo foo.f)
|
add_library(foo foo.f)
|
||||||
|
|||||||
Reference in New Issue
Block a user