|
|
|
@@ -270,7 +270,20 @@ if (NOT ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")) |
|
|
|
add_compile_options("-D_REENTRANT") |
|
|
|
endif() |
|
|
|
|
|
|
|
if (DISABLE_BSYMBOLIC STREQUAL "OFF") |
|
|
|
# OSX Mach-O doesn't support linking with '-Bsymbolic-functions'. |
|
|
|
# Others may not support it, too. |
|
|
|
list(APPEND CMAKE_REQUIRED_LIBRARIES "-Wl,-Bsymbolic-functions") |
|
|
|
check_c_source_compiles( |
|
|
|
[=[ |
|
|
|
int main () |
|
|
|
{ |
|
|
|
return 0; |
|
|
|
} |
|
|
|
]=] |
|
|
|
BSYMBOLIC_WORKS |
|
|
|
) |
|
|
|
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "-Wl,-Bsymbolic-functions") |
|
|
|
if (DISABLE_BSYMBOLIC STREQUAL "OFF" AND BSYMBOLIC_WORKS) |
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-Bsymbolic-functions") |
|
|
|
# XXX need cmake>=3.13 for this: |
|
|
|
#add_link_options("-Wl,-Bsymbolic-functions") |
|
|
|
|