Merge topic 'solaris-fix-target_link_libraries-test'
0778016a
Tests: Do not try to use invalid "ld -v" flag on Solaris
This commit is contained in:
commit
0fa263d9d0
|
@ -22,8 +22,18 @@ generate_export_header(staticlib1)
|
||||||
add_library(staticlib2 STATIC staticlib2.cpp)
|
add_library(staticlib2 STATIC staticlib2.cpp)
|
||||||
generate_export_header(staticlib2)
|
generate_export_header(staticlib2)
|
||||||
target_link_libraries(staticlib1 LINK_PUBLIC 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)
|
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()
|
endif()
|
||||||
|
|
||||||
add_executable(staticlib_exe staticlib_exe.cpp)
|
add_executable(staticlib_exe staticlib_exe.cpp)
|
||||||
|
|
Loading…
Reference in New Issue