From d68f00e4d8b061f56d3bd46d5ed1bc51406a4f1a Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Fri, 16 Mar 2018 12:14:27 -0700 Subject: [PATCH] Do feature test before adding -Bsymbolic-functions, cmake part (#889) --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ddc15a7c..85709b2e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -537,7 +537,11 @@ target_link_libraries(harfbuzz-subset harfbuzz ${THIRD_PARTY_LIBS}) if (UNIX OR MINGW) # Make symbols link locally - link_libraries(-Bsymbolic-functions) + include(CheckCXXCompilerFlag) + check_cxx_compiler_flag(-Bsymbolic-functions CXX_SUPPORTS_FLAG_BSYMB_FUNCS) + if(CXX_SUPPORTS_FLAG_BSYMB_FUNCS) + link_libraries(-Bsymbolic-functions) + endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # Make sure we don't link to libstdc++