[Cmake-commits] CMake branch, next, updated. v3.8.0-789-gf4090db
Kitware Robot
kwrobot at kitware.com
Tue Apr 18 12:05:02 EDT 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via f4090db2eebe4950d1034609f8dbebaae5bf87f7 (commit)
via eeb58c5c34a888acbb422e66ff7895cb35c9322a (commit)
from 94d540e50f8beaa7cb8e6c43be0fa8c00dc58d25 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f4090db2eebe4950d1034609f8dbebaae5bf87f7
commit f4090db2eebe4950d1034609f8dbebaae5bf87f7
Merge: 94d540e eeb58c5
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Apr 18 15:55:40 2017 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Apr 18 11:55:45 2017 -0400
Stage topic 'test-CheckIPOSupported'
Topic-id: 23653
Topic-url: https://gitlab.kitware.com/cmake/cmake/merge_requests/700
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eeb58c5c34a888acbb422e66ff7895cb35c9322a
commit eeb58c5c34a888acbb422e66ff7895cb35c9322a
Author: Ruslan Baratov <ruslan_baratov at yahoo.com>
AuthorDate: Thu Apr 13 23:05:16 2017 +0800
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Apr 18 11:54:33 2017 -0400
Tests: Add cases for typical CheckIPOSupported usage
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 910ff39..baa6813 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -477,6 +477,17 @@ if(BUILD_TESTING)
ADD_TEST_MACRO(Module.CheckTypeSize CheckTypeSize)
+ set(Module.CheckIPOSupported-C_BUILD_OPTIONS -DCMake_TEST_IPO_WORKS_C=${CMake_TEST_IPO_WORKS_C})
+ ADD_TEST_MACRO(Module.CheckIPOSupported-C CheckIPOSupported-C)
+
+ set(Module.CheckIPOSupported-CXX_BUILD_OPTIONS -DCMake_TEST_IPO_WORKS_CXX=${CMake_TEST_IPO_WORKS_CXX})
+ ADD_TEST_MACRO(Module.CheckIPOSupported-CXX CheckIPOSupported-CXX)
+
+ if(CMAKE_Fortran_COMPILER)
+ set(Module.CheckIPOSupported-Fortran_BUILD_OPTIONS -DCMake_TEST_IPO_WORKS_Fortran=${CMake_TEST_IPO_WORKS_Fortran})
+ ADD_TEST_MACRO(Module.CheckIPOSupported-Fortran CheckIPOSupported-Fortran)
+ endif()
+
add_test(Module.ExternalData ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/Module/ExternalData"
diff --git a/Tests/Module/CheckIPOSupported-C/CMakeLists.txt b/Tests/Module/CheckIPOSupported-C/CMakeLists.txt
new file mode 100644
index 0000000..607dcd3
--- /dev/null
+++ b/Tests/Module/CheckIPOSupported-C/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 3.8)
+project(CheckIPOSupported-C LANGUAGES C)
+
+cmake_policy(SET CMP0069 NEW)
+
+include(CheckIPOSupported)
+check_ipo_supported(RESULT ipo_supported)
+if(ipo_supported)
+ set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
+elseif(CMake_TEST_IPO_WORKS_C)
+ message(FATAL_ERROR "IPO expected to work")
+endif()
+
+add_library(foo foo.c)
+add_executable(CheckIPOSupported-C main.c)
+target_link_libraries(CheckIPOSupported-C PUBLIC foo)
+
+enable_testing()
+add_test(NAME CheckIPOSupported-C COMMAND CheckIPOSupported-C)
diff --git a/Tests/Module/CheckIPOSupported-C/foo.c b/Tests/Module/CheckIPOSupported-C/foo.c
new file mode 100644
index 0000000..1e56597
--- /dev/null
+++ b/Tests/Module/CheckIPOSupported-C/foo.c
@@ -0,0 +1,4 @@
+int foo()
+{
+ return 0x42;
+}
diff --git a/Tests/Module/CheckIPOSupported-C/main.c b/Tests/Module/CheckIPOSupported-C/main.c
new file mode 100644
index 0000000..99204ab
--- /dev/null
+++ b/Tests/Module/CheckIPOSupported-C/main.c
@@ -0,0 +1,9 @@
+int foo();
+
+int main()
+{
+ if (foo() == 0) {
+ return 1;
+ }
+ return 0;
+}
diff --git a/Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt b/Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt
new file mode 100644
index 0000000..2dede93
--- /dev/null
+++ b/Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 3.8)
+project(CheckIPOSupported-CXX LANGUAGES CXX)
+
+cmake_policy(SET CMP0069 NEW)
+
+include(CheckIPOSupported)
+check_ipo_supported(RESULT ipo_supported)
+if(ipo_supported)
+ set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
+elseif(CMake_TEST_IPO_WORKS_CXX)
+ message(FATAL_ERROR "IPO expected to work")
+endif()
+
+add_library(foo foo.cpp)
+add_executable(CheckIPOSupported-CXX main.cpp)
+target_link_libraries(CheckIPOSupported-CXX PUBLIC foo)
+
+enable_testing()
+add_test(NAME CheckIPOSupported-CXX COMMAND CheckIPOSupported-CXX)
diff --git a/Tests/Module/CheckIPOSupported-CXX/foo.cpp b/Tests/Module/CheckIPOSupported-CXX/foo.cpp
new file mode 100644
index 0000000..1e56597
--- /dev/null
+++ b/Tests/Module/CheckIPOSupported-CXX/foo.cpp
@@ -0,0 +1,4 @@
+int foo()
+{
+ return 0x42;
+}
diff --git a/Tests/Module/CheckIPOSupported-CXX/main.cpp b/Tests/Module/CheckIPOSupported-CXX/main.cpp
new file mode 100644
index 0000000..99204ab
--- /dev/null
+++ b/Tests/Module/CheckIPOSupported-CXX/main.cpp
@@ -0,0 +1,9 @@
+int foo();
+
+int main()
+{
+ if (foo() == 0) {
+ return 1;
+ }
+ return 0;
+}
diff --git a/Tests/Module/CheckIPOSupported-Fortran/CMakeLists.txt b/Tests/Module/CheckIPOSupported-Fortran/CMakeLists.txt
new file mode 100644
index 0000000..dee5c25
--- /dev/null
+++ b/Tests/Module/CheckIPOSupported-Fortran/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 3.8)
+project(CheckIPOSupported-Fortran LANGUAGES Fortran)
+
+cmake_policy(SET CMP0069 NEW)
+
+include(CheckIPOSupported)
+check_ipo_supported(RESULT ipo_supported)
+if(ipo_supported)
+ set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
+elseif(CMake_TEST_IPO_WORKS_Fortran)
+ message(FATAL_ERROR "IPO expected to work")
+endif()
+
+add_library(foo foo.f)
+add_executable(CheckIPOSupported-Fortran main.f)
+target_link_libraries(CheckIPOSupported-Fortran PUBLIC foo)
+
+enable_testing()
+add_test(NAME CheckIPOSupported-Fortran COMMAND CheckIPOSupported-Fortran)
diff --git a/Tests/Module/CheckIPOSupported-Fortran/foo.f b/Tests/Module/CheckIPOSupported-Fortran/foo.f
new file mode 100644
index 0000000..945d2d5
--- /dev/null
+++ b/Tests/Module/CheckIPOSupported-Fortran/foo.f
@@ -0,0 +1,2 @@
+ SUBROUTINE FOO
+ END
diff --git a/Tests/Module/CheckIPOSupported-Fortran/main.f b/Tests/Module/CheckIPOSupported-Fortran/main.f
new file mode 100644
index 0000000..9d1de9f
--- /dev/null
+++ b/Tests/Module/CheckIPOSupported-Fortran/main.f
@@ -0,0 +1,3 @@
+ PROGRAM BOO
+ CALL FOO()
+ END
-----------------------------------------------------------------------
Summary of changes:
Tests/CMakeLists.txt | 11 +++++++++++
Tests/Module/CheckIPOSupported-C/CMakeLists.txt | 19 +++++++++++++++++++
.../Module/CheckIPOSupported-C}/foo.c | 0
Tests/Module/CheckIPOSupported-C/main.c | 9 +++++++++
Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt | 19 +++++++++++++++++++
.../Module/CheckIPOSupported-CXX}/foo.cpp | 0
Tests/Module/CheckIPOSupported-CXX/main.cpp | 9 +++++++++
.../Module/CheckIPOSupported-Fortran/CMakeLists.txt | 19 +++++++++++++++++++
.../Module/CheckIPOSupported-Fortran}/foo.f | 0
.../Module/CheckIPOSupported-Fortran}/main.f | 0
10 files changed, 86 insertions(+)
create mode 100644 Tests/Module/CheckIPOSupported-C/CMakeLists.txt
copy {Modules/CheckIPOSupported => Tests/Module/CheckIPOSupported-C}/foo.c (100%)
create mode 100644 Tests/Module/CheckIPOSupported-C/main.c
create mode 100644 Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt
copy {Modules/CheckIPOSupported => Tests/Module/CheckIPOSupported-CXX}/foo.cpp (100%)
create mode 100644 Tests/Module/CheckIPOSupported-CXX/main.cpp
create mode 100644 Tests/Module/CheckIPOSupported-Fortran/CMakeLists.txt
copy {Modules/CheckIPOSupported => Tests/Module/CheckIPOSupported-Fortran}/foo.f (100%)
copy {Modules/CheckIPOSupported => Tests/Module/CheckIPOSupported-Fortran}/main.f (100%)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list