summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CheckIPOSupported
diff options
context:
space:
mode:
authorRuslan Baratov <ruslan_baratov@yahoo.com>2017-03-09 13:05:19 (GMT)
committerBrad King <brad.king@kitware.com>2017-03-30 18:56:46 (GMT)
commit1588a577d16cfb1a689a444b1db1df3ccff2cc3d (patch)
tree1c4e4a60729202be6992079fc41501d736caefb2 /Tests/RunCMake/CheckIPOSupported
parenta75757004bda0ff32a152a0d9d6379c02b1338ce (diff)
downloadCMake-1588a577d16cfb1a689a444b1db1df3ccff2cc3d.zip
CMake-1588a577d16cfb1a689a444b1db1df3ccff2cc3d.tar.gz
CMake-1588a577d16cfb1a689a444b1db1df3ccff2cc3d.tar.bz2
Add policy CMP0069 to enforce INTERPROCEDURAL_OPTIMIZATION
Previously the `INTERPROCEDURAL_OPTIMIZATION` target property was honored only for the Intel compiler on Linux and otherwise ignored. In order to add support for more compilers incrementally without changing behavior in the future, add a new policy whose NEW behavior enforces the `INTERPROCEDURAL_OPTIMIZATION` property. Add flags for supported compilers and otherwise produce an error.
Diffstat (limited to 'Tests/RunCMake/CheckIPOSupported')
-rw-r--r--Tests/RunCMake/CheckIPOSupported/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CheckIPOSupported/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-result.txt1
-rw-r--r--Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-stderr.txt5
-rw-r--r--Tests/RunCMake/CheckIPOSupported/cmp0069-is-old.cmake6
5 files changed, 16 insertions, 0 deletions
diff --git a/Tests/RunCMake/CheckIPOSupported/CMakeLists.txt b/Tests/RunCMake/CheckIPOSupported/CMakeLists.txt
index a0effc9..4a13d29 100644
--- a/Tests/RunCMake/CheckIPOSupported/CMakeLists.txt
+++ b/Tests/RunCMake/CheckIPOSupported/CMakeLists.txt
@@ -1,4 +1,7 @@
cmake_minimum_required(VERSION 3.0)
project(${RunCMake_TEST} NONE)
+
+cmake_policy(SET CMP0069 NEW)
+
include(CheckIPOSupported)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CheckIPOSupported/RunCMakeTest.cmake b/Tests/RunCMake/CheckIPOSupported/RunCMakeTest.cmake
index 2815037..812f79b 100644
--- a/Tests/RunCMake/CheckIPOSupported/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CheckIPOSupported/RunCMakeTest.cmake
@@ -7,6 +7,7 @@ run_cmake(default-lang-none)
run_cmake(not-supported-by-cmake)
run_cmake(not-supported-by-compiler)
run_cmake(save-to-result)
+run_cmake(cmp0069-is-old)
if(RunCMake_GENERATOR MATCHES "^(Visual Studio |Xcode$)")
run_cmake(not-supported-by-generator)
diff --git a/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-result.txt b/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-stderr.txt b/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-stderr.txt
new file mode 100644
index 0000000..f183594
--- /dev/null
+++ b/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Error at .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(message\):
+ Policy CMP0069 set to OLD
+Call Stack \(most recent call first\):
+ cmp0069-is-old\.cmake:[0-9]+ \(check_ipo_supported\)
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old.cmake b/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old.cmake
new file mode 100644
index 0000000..14fed04
--- /dev/null
+++ b/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old.cmake
@@ -0,0 +1,6 @@
+project(${RunCMake_TEST} LANGUAGES C CXX)
+
+cmake_policy(SET CMP0069 OLD)
+
+include(CheckIPOSupported)
+check_ipo_supported()