# -fvisibility=hidden # --------------------- # change the default visibility of symbols # check if the compiler supports it check_cxx_compiler_flag( "-fvisibility=hidden" HAS_VISIBILITY_HIDDEN ) # define a set of files to be compiled with the -fvisibility=hidden flag function( set_visibility_flag ) if ( HAS_VISIBILITY_HIDDEN ) set_property( SOURCE ${ARGN} APPEND PROPERTY COMPILE_FLAGS "-fvisibility=hidden -fvisibility-inlines-hidden" ) endif() endfunction( set_visibility_flag )