CheckIPOSupported: Visual Studio and Xcode generators do not support IPO

This commit is contained in:
Ruslan Baratov
2017-03-30 10:57:01 +08:00
committed by Brad King
parent 9a733c7bd6
commit e05835c35b
6 changed files with 24 additions and 2 deletions

View File

@@ -203,7 +203,12 @@ function(check_ipo_supported)
endif()
if(NOT _CMAKE_IPO_MAY_BE_SUPPORTED_BY_COMPILER)
_ipo_not_supported("compiler doesn't support IPO")
_ipo_not_supported("Compiler doesn't support IPO")
return()
endif()
if(CMAKE_GENERATOR MATCHES "^(Visual Studio |Xcode$)")
_ipo_not_supported("CMake doesn't support IPO for current generator")
return()
endif()

View File

@@ -7,3 +7,7 @@ run_cmake(default-lang-none)
run_cmake(not-supported-by-cmake)
run_cmake(not-supported-by-compiler)
run_cmake(save-to-result)
if(RunCMake_GENERATOR MATCHES "^(Visual Studio |Xcode$)")
run_cmake(not-supported-by-generator)
endif()

View File

@@ -1,5 +1,5 @@
^CMake Error at .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(message\):
IPO is not supported \(compiler doesn't support IPO\)\.
IPO is not supported \(Compiler doesn't support IPO\)\.
Call Stack \(most recent call first\):
.*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(_ipo_not_supported\)
not-supported-by-compiler\.cmake:[0-9]+ \(check_ipo_supported\)

View File

@@ -0,0 +1,6 @@
^CMake Error at .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(message\):
IPO is not supported \(CMake doesn't support IPO for current generator\)\.
Call Stack \(most recent call first\):
.*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(_ipo_not_supported\)
not-supported-by-generator\.cmake:[0-9]+ \(check_ipo_supported\)
CMakeLists\.txt:[0-9]+ \(include\)$

View File

@@ -0,0 +1,6 @@
project(${RunCMake_TEST} LANGUAGES C)
set(_CMAKE_IPO_SUPPORTED_BY_CMAKE YES)
set(_CMAKE_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES)
check_ipo_supported()