summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeCommands
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2018-08-11 10:57:42 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2018-08-15 12:40:36 (GMT)
commit174721ecc04036f5a68982a451a96e47f9ac0c8f (patch)
treee320fa4476db23682c4ea96441b940b5fa169c97 /Tests/CMakeCommands
parent349f8bfb25349892fb2c4e5a9942e4bd63f86f49 (diff)
downloadCMake-174721ecc04036f5a68982a451a96e47f9ac0c8f.zip
CMake-174721ecc04036f5a68982a451a96e47f9ac0c8f.tar.gz
CMake-174721ecc04036f5a68982a451a96e47f9ac0c8f.tar.bz2
LINK_OPTIONS property: add test for static library.
Check that property INTERFACE_LINK_OPTIONS is correctly propagated from static libraries. Issue: #18251
Diffstat (limited to 'Tests/CMakeCommands')
-rw-r--r--Tests/CMakeCommands/target_link_options/CMakeLists.txt9
1 files changed, 8 insertions, 1 deletions
diff --git a/Tests/CMakeCommands/target_link_options/CMakeLists.txt b/Tests/CMakeCommands/target_link_options/CMakeLists.txt
index c66cd37..3bb6ff3 100644
--- a/Tests/CMakeCommands/target_link_options/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_options/CMakeLists.txt
@@ -15,5 +15,12 @@ if (NOT result MATCHES "-PRIVATE_FLAG")
endif()
get_target_property(result target_link_options_2 INTERFACE_LINK_OPTIONS)
if (NOT result MATCHES "-INTERFACE_FLAG")
- message(SEND_ERROR "target_link_options not populated the INTERFACE_LINK_OPTIONS target property")
+ message(SEND_ERROR "target_link_options not populated the INTERFACE_LINK_OPTIONS target property of shared library")
+endif()
+
+add_library(target_link_options_3 STATIC EXCLUDE_FROM_ALL LinkOptionsLib.c)
+target_link_options(target_link_options_3 INTERFACE -INTERFACE_FLAG)
+get_target_property(result target_link_options_3 INTERFACE_LINK_OPTIONS)
+if (NOT result MATCHES "-INTERFACE_FLAG")
+ message(SEND_ERROR "target_link_options not populated the INTERFACE_LINK_OPTIONS target property of static library")
endif()