summaryrefslogtreecommitdiffstats
path: root/Modules/CheckIPOSupported
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-03-22 12:51:54 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-03-22 12:51:59 (GMT)
commit56c39d88363b3a0518bde1569d18ef1bdbeb01e7 (patch)
tree14430d55136d7ef1b14395ce4123ed19864914a7 /Modules/CheckIPOSupported
parent53e2ef1bb4434081bedce3742105e378452c4c38 (diff)
parent6c8326749fccd37afd5343d926d650c87ecdfb9f (diff)
downloadCMake-56c39d88363b3a0518bde1569d18ef1bdbeb01e7.zip
CMake-56c39d88363b3a0518bde1569d18ef1bdbeb01e7.tar.gz
CMake-56c39d88363b3a0518bde1569d18ef1bdbeb01e7.tar.bz2
Merge topic 'add-CheckIPOSupported-module'
6c832674 Tests for 'CheckIPOSupported' module fdb2ba25 CheckIPOSupported: New module to check for compiler/cmake IPO support Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !558
Diffstat (limited to 'Modules/CheckIPOSupported')
-rw-r--r--Modules/CheckIPOSupported/CMakeLists-C.txt.in8
-rw-r--r--Modules/CheckIPOSupported/CMakeLists-CXX.txt.in8
-rw-r--r--Modules/CheckIPOSupported/foo.c4
-rw-r--r--Modules/CheckIPOSupported/foo.cpp4
-rw-r--r--Modules/CheckIPOSupported/main.c6
-rw-r--r--Modules/CheckIPOSupported/main.cpp6
6 files changed, 36 insertions, 0 deletions
diff --git a/Modules/CheckIPOSupported/CMakeLists-C.txt.in b/Modules/CheckIPOSupported/CMakeLists-C.txt.in
new file mode 100644
index 0000000..d20f31f
--- /dev/null
+++ b/Modules/CheckIPOSupported/CMakeLists-C.txt.in
@@ -0,0 +1,8 @@
+cmake_minimum_required(VERSION "@CMAKE_VERSION@")
+project("@TRY_COMPILE_PROJECT_NAME@" LANGUAGES C)
+
+# TODO: IPO policy
+
+add_library(foo foo.c)
+add_executable(boo main.c)
+target_link_libraries(boo PUBLIC foo)
diff --git a/Modules/CheckIPOSupported/CMakeLists-CXX.txt.in b/Modules/CheckIPOSupported/CMakeLists-CXX.txt.in
new file mode 100644
index 0000000..4b55c70
--- /dev/null
+++ b/Modules/CheckIPOSupported/CMakeLists-CXX.txt.in
@@ -0,0 +1,8 @@
+cmake_minimum_required(VERSION "@CMAKE_VERSION@")
+project("@TRY_COMPILE_PROJECT_NAME@" LANGUAGES CXX)
+
+# TODO: IPO policy
+
+add_library(foo foo.cpp)
+add_executable(boo main.cpp)
+target_link_libraries(boo PUBLIC foo)
diff --git a/Modules/CheckIPOSupported/foo.c b/Modules/CheckIPOSupported/foo.c
new file mode 100644
index 0000000..1e56597
--- /dev/null
+++ b/Modules/CheckIPOSupported/foo.c
@@ -0,0 +1,4 @@
+int foo()
+{
+ return 0x42;
+}
diff --git a/Modules/CheckIPOSupported/foo.cpp b/Modules/CheckIPOSupported/foo.cpp
new file mode 100644
index 0000000..1e56597
--- /dev/null
+++ b/Modules/CheckIPOSupported/foo.cpp
@@ -0,0 +1,4 @@
+int foo()
+{
+ return 0x42;
+}
diff --git a/Modules/CheckIPOSupported/main.c b/Modules/CheckIPOSupported/main.c
new file mode 100644
index 0000000..5be0864
--- /dev/null
+++ b/Modules/CheckIPOSupported/main.c
@@ -0,0 +1,6 @@
+int foo();
+
+int main()
+{
+ return foo();
+}
diff --git a/Modules/CheckIPOSupported/main.cpp b/Modules/CheckIPOSupported/main.cpp
new file mode 100644
index 0000000..5be0864
--- /dev/null
+++ b/Modules/CheckIPOSupported/main.cpp
@@ -0,0 +1,6 @@
+int foo();
+
+int main()
+{
+ return foo();
+}