summaryrefslogtreecommitdiffstats
path: root/Tests/LinkFlags
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-05-28 13:47:12 (GMT)
committerBrad King <brad.king@kitware.com>2010-05-28 15:01:42 (GMT)
commitd3303dbc8130988be63b9dda913eb9af9770edeb (patch)
tree06ac8636c106f555ccd93219c0487d18de212272 /Tests/LinkFlags
parent159606c3667e006bba59490c2cae82871f25d773 (diff)
downloadCMake-d3303dbc8130988be63b9dda913eb9af9770edeb.zip
CMake-d3303dbc8130988be63b9dda913eb9af9770edeb.tar.gz
CMake-d3303dbc8130988be63b9dda913eb9af9770edeb.tar.bz2
Test LINK_FLAGS and STATIC_LIBRARY_FLAGS (#10768)
Add a LinkFlags test series to check that these properties work. Since no link flag is accepted everywhere we test for presence of flags by adding a bad flag and looking for the complaint in the test output.
Diffstat (limited to 'Tests/LinkFlags')
-rw-r--r--Tests/LinkFlags/CMakeLists.txt24
-rw-r--r--Tests/LinkFlags/LinkFlags.c1
-rw-r--r--Tests/LinkFlags/LinkFlagsLib.c1
3 files changed, 26 insertions, 0 deletions
diff --git a/Tests/LinkFlags/CMakeLists.txt b/Tests/LinkFlags/CMakeLists.txt
new file mode 100644
index 0000000..48161f1
--- /dev/null
+++ b/Tests/LinkFlags/CMakeLists.txt
@@ -0,0 +1,24 @@
+cmake_minimum_required(VERSION 2.8)
+project(LinkFlags C)
+
+string(TOUPPER "${TEST_CONFIG}" TEST_CONFIG_UPPER)
+
+add_library(LinkFlags_lib STATIC LinkFlagsLib.c)
+set_property(TARGET LinkFlags_lib PROPERTY STATIC_LIBRARY_FLAGS _BADFLAG_)
+
+add_library(LinkFlags_dll SHARED LinkFlagsLib.c)
+set_property(TARGET LinkFlags_dll PROPERTY LINK_FLAGS _BADFLAG_)
+
+add_executable(LinkFlags_exe LinkFlags.c)
+set_property(TARGET LinkFlags_exe PROPERTY LINK_FLAGS _BADFLAG_)
+
+add_library(LinkFlags_lib_config STATIC LinkFlagsLib.c)
+set_property(TARGET LinkFlags_lib_config PROPERTY STATIC_LIBRARY_FLAGS_${TEST_CONFIG_UPPER} _BADFLAG_${TEST_CONFIG}_)
+
+add_library(LinkFlags_dll_config SHARED LinkFlagsLib.c)
+set_property(TARGET LinkFlags_dll_config PROPERTY LINK_FLAGS_${TEST_CONFIG_UPPER} _BADFLAG_${TEST_CONFIG}_)
+
+add_executable(LinkFlags_exe_config LinkFlags.c)
+set_property(TARGET LinkFlags_exe_config PROPERTY LINK_FLAGS_${TEST_CONFIG_UPPER} _BADFLAG_${TEST_CONFIG}_)
+
+add_executable(LinkFlags LinkFlags.c)
diff --git a/Tests/LinkFlags/LinkFlags.c b/Tests/LinkFlags/LinkFlags.c
new file mode 100644
index 0000000..78f2de1
--- /dev/null
+++ b/Tests/LinkFlags/LinkFlags.c
@@ -0,0 +1 @@
+int main(void) { return 0; }
diff --git a/Tests/LinkFlags/LinkFlagsLib.c b/Tests/LinkFlags/LinkFlagsLib.c
new file mode 100644
index 0000000..f002eef
--- /dev/null
+++ b/Tests/LinkFlags/LinkFlagsLib.c
@@ -0,0 +1 @@
+int flags_lib(void) { return 0; }