Remove clang+osx ld warning

Boost libraries on osx use visibility=hidden to reduce unnecessary DWARF entries.

Unless we match visibility, ld will give a warning message like:

   ld: warning: direct access in function 'boost::filesystem... from file ...
   means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
This commit is contained in:
rocky 2019-04-30 07:38:28 -04:00
parent eac0048176
commit b3ef7e2301

View File

@ -54,6 +54,12 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
# Set stack size to 32MB - by default Apple's clang defines a stack size of 8MB.
# Normally 16MB is enough to run all tests, but it will exceed the stack, if -DSANITIZE=address is used.
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-stack_size -Wl,0x2000000")
# Boost libraries use visibility=hidden to reduce unnecessary DWARF entries.
# Unless we match visibility, ld will give a warning message like:
# ld: warning: direct access in function 'boost::filesystem... from file ...
# means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
endif()
# Some Linux-specific Clang settings. We don't want these for OS X.