summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/target_compile_options
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2018-10-26 09:11:42 -0400
committerBen Boeckel <ben.boeckel@kitware.com>2018-10-26 12:08:05 -0400
commit4201a11c2b5a5bdb442f99f88a5f17d6ae7c4a4c (patch)
treeecf5018aede6ad380f97b640300d607ce9878b29 /Tests/RunCMake/target_compile_options
parent9e78be8065f6c9c9f363b3e495017715abf9303b (diff)
downloadcmake-4201a11c2b5a5bdb442f99f88a5f17d6ae7c4a4c.tar.gz
Tests: add tests for empty-value keyword arguments in target_*
Not all of these commands accept non-compilable (i.e., IMPORTED) targets, so those calls are currently just commented out. If they ever do start to accept them, the tests should be enabled.
Diffstat (limited to 'Tests/RunCMake/target_compile_options')
-rw-r--r--Tests/RunCMake/target_compile_options/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/target_compile_options/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/target_compile_options/empty_keyword_args-result.txt1
-rw-r--r--Tests/RunCMake/target_compile_options/empty_keyword_args-stderr.txt5
-rw-r--r--Tests/RunCMake/target_compile_options/empty_keyword_args.cmake5
5 files changed, 19 insertions, 0 deletions
diff --git a/Tests/RunCMake/target_compile_options/CMakeLists.txt b/Tests/RunCMake/target_compile_options/CMakeLists.txt
new file mode 100644
index 0000000000..14ef56e8e8
--- /dev/null
+++ b/Tests/RunCMake/target_compile_options/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.11)
+
+project(${RunCMake_TEST} LANGUAGES NONE)
+
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/target_compile_options/RunCMakeTest.cmake b/Tests/RunCMake/target_compile_options/RunCMakeTest.cmake
new file mode 100644
index 0000000000..b67c5983eb
--- /dev/null
+++ b/Tests/RunCMake/target_compile_options/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(empty_keyword_args)
diff --git a/Tests/RunCMake/target_compile_options/empty_keyword_args-result.txt b/Tests/RunCMake/target_compile_options/empty_keyword_args-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/target_compile_options/empty_keyword_args-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/target_compile_options/empty_keyword_args-stderr.txt b/Tests/RunCMake/target_compile_options/empty_keyword_args-stderr.txt
new file mode 100644
index 0000000000..381ff48259
--- /dev/null
+++ b/Tests/RunCMake/target_compile_options/empty_keyword_args-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at empty_keyword_args.cmake:2 \(target_compile_options\):
+ target_compile_options may only set INTERFACE properties on INTERFACE
+ targets
+Call Stack \(most recent call first\):
+ CMakeLists.txt:5 \(include\)
diff --git a/Tests/RunCMake/target_compile_options/empty_keyword_args.cmake b/Tests/RunCMake/target_compile_options/empty_keyword_args.cmake
new file mode 100644
index 0000000000..8b92fcf161
--- /dev/null
+++ b/Tests/RunCMake/target_compile_options/empty_keyword_args.cmake
@@ -0,0 +1,5 @@
+add_library(iface INTERFACE)
+target_compile_options(iface PUBLIC PRIVATE INTERFACE)
+# Cannot be called with non-compilable targets.
+#add_library(imported UNKNOWN IMPORTED)
+#target_compile_options(imported PUBLIC PRIVATE INTERFACE)