diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2018-10-26 13:11:42 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2018-10-26 16:08:05 (GMT) |
commit | 4201a11c2b5a5bdb442f99f88a5f17d6ae7c4a4c (patch) | |
tree | ecf5018aede6ad380f97b640300d607ce9878b29 /Tests/RunCMake/target_link_options | |
parent | 9e78be8065f6c9c9f363b3e495017715abf9303b (diff) | |
download | CMake-4201a11c2b5a5bdb442f99f88a5f17d6ae7c4a4c.zip CMake-4201a11c2b5a5bdb442f99f88a5f17d6ae7c4a4c.tar.gz CMake-4201a11c2b5a5bdb442f99f88a5f17d6ae7c4a4c.tar.bz2 |
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_link_options')
4 files changed, 12 insertions, 0 deletions
diff --git a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake index 1eaa5d2..1d9ef8b 100644 --- a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake @@ -39,3 +39,5 @@ if(RunCMake_GENERATOR MATCHES "(Ninja|Makefile)") run_cmake_target(LINKER_expansion LINKER linker) run_cmake_target(LINKER_expansion LINKER_SHELL linker_shell) endif() + +run_cmake(empty_keyword_args) diff --git a/Tests/RunCMake/target_link_options/empty_keyword_args-result.txt b/Tests/RunCMake/target_link_options/empty_keyword_args-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/target_link_options/empty_keyword_args-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_link_options/empty_keyword_args-stderr.txt b/Tests/RunCMake/target_link_options/empty_keyword_args-stderr.txt new file mode 100644 index 0000000..0103d00 --- /dev/null +++ b/Tests/RunCMake/target_link_options/empty_keyword_args-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at empty_keyword_args.cmake:2 \(target_link_options\): + target_link_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_link_options/empty_keyword_args.cmake b/Tests/RunCMake/target_link_options/empty_keyword_args.cmake new file mode 100644 index 0000000..a1a297e --- /dev/null +++ b/Tests/RunCMake/target_link_options/empty_keyword_args.cmake @@ -0,0 +1,5 @@ +add_library(iface INTERFACE) +target_link_options(iface PUBLIC PRIVATE INTERFACE) +# Cannot be called with non-compilable targets. +#add_library(imported UNKNOWN IMPORTED) +#target_link_options(imported PUBLIC PRIVATE INTERFACE) |