Merge pull request #9913 from alalek:fix_fvisibility_regression

This commit is contained in:
Maksim Shabunin 2017-10-23 12:22:16 +00:00
commit ab5e09e428

View File

@ -280,7 +280,7 @@ set(OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE "${OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEA
set(OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG "${OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG}" CACHE INTERNAL "Extra linker flags for Debug build")
# set default visibility to hidden
if((CMAKE_COMPILER_ID STREQUAL "GNU" OR CMAKE_COMPILER_ID STREQUAL "Clang")
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
AND NOT OPENCV_SKIP_VISIBILITY_HIDDEN
AND NOT CMAKE_CXX_FLAGS MATCHES "-fvisibility")
add_extra_compiler_option(-fvisibility=hidden)