summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeCommands
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-03-31 15:20:20 (GMT)
committerBrad King <brad.king@kitware.com>2015-03-31 15:21:36 (GMT)
commit0778016a0bba246e46f628aecd64e0f8afcc0fdb (patch)
tree147247ecd150a75debf0072ea90a0ba2fea2017b /Tests/CMakeCommands
parented989122c3b997b19c714ce511619e6b6204a1f1 (diff)
downloadCMake-0778016a0bba246e46f628aecd64e0f8afcc0fdb.zip
CMake-0778016a0bba246e46f628aecd64e0f8afcc0fdb.tar.gz
CMake-0778016a0bba246e46f628aecd64e0f8afcc0fdb.tar.bz2
Tests: Do not try to use invalid "ld -v" flag on Solaris
Fix the CMakeCommands.target_link_libraries test to use "-V" instead of "-v" on Solaris because the latter does not exist.
Diffstat (limited to 'Tests/CMakeCommands')
-rw-r--r--Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt12
1 files changed, 11 insertions, 1 deletions
diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt
index 818b8c9..741c73e 100644
--- a/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt
@@ -22,8 +22,18 @@ generate_export_header(staticlib1)
add_library(staticlib2 STATIC staticlib2.cpp)
generate_export_header(staticlib2)
target_link_libraries(staticlib1 LINK_PUBLIC staticlib2)
+
+# Try adding a private link item to be propagated out of a static lib.
+set(private_link "")
if (CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
- target_link_libraries(staticlib1 LINK_PRIVATE "-Wl,-v")
+ if (CMAKE_SYSTEM_NAME STREQUAL "SunOS")
+ set(private_link "-Wl,-V")
+ else()
+ set(private_link "-Wl,-v")
+ endif()
+endif()
+if(private_link)
+ target_link_libraries(staticlib1 LINK_PRIVATE "${private_link}")
endif()
add_executable(staticlib_exe staticlib_exe.cpp)