diff options
author | Jakub Zakrzewski <slither.jz@gmail.com> | 2016-09-04 12:37:46 +0200 |
---|---|---|
committer | Jakub Zakrzewski <slither.jz@gmail.com> | 2016-09-10 00:35:38 +0200 |
commit | 6140dfcf3e7845f11dee755de6865379aa96dab7 (patch) | |
tree | b04e4001ee22651132fda45756d04105362514d1 /tests/libtest | |
parent | 83ef21e5e9946de2805ae10cc5e6ef9431b22702 (diff) |
CMake: Try to (un-)hide private library symbols
Detect support for compiler symbol visibility flags and apply those
according to CURL_HIDDEN_SYMBOLS option.
It should work true to the autotools build except it tries to unhide
symbols on Windows when requested and prints warning if it fails.
Ref: https://github.com/curl/curl/issues/981#issuecomment-242665951
Reported-by: Daniel Stenberg
Diffstat (limited to 'tests/libtest')
-rw-r--r-- | tests/libtest/CMakeLists.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/libtest/CMakeLists.txt b/tests/libtest/CMakeLists.txt index cc9d7e1f8..a7449c374 100644 --- a/tests/libtest/CMakeLists.txt +++ b/tests/libtest/CMakeLists.txt @@ -43,6 +43,10 @@ if(NOT WIN32) # library at (tests)/libtest/.libs/libhostname.so set_target_properties(hostname PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/.libs) + if(HIDES_CURL_PRIVATE_SYMBOLS) + set_property(TARGET hostname APPEND PROPERTY COMPILE_DEFINITIONS "CURL_HIDDEN_SYMBOLS") + set_property(TARGET hostname APPEND PROPERTY COMPILE_FLAGS ${CURL_CFLAG_SYMBOLS_HIDE}) + endif() endif() # # files used only in some libcurl test programs |