mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 00:32:57 -04:00
CMake: Use -fvisibility=hidden everywhere supported
This commit is contained in:
parent
9ee4f1f4e2
commit
768a8d62e9
@ -111,6 +111,16 @@ add_compile_options(
|
|||||||
"$<${cxx_exceptions_property}:${cxx_exceptions_on}>"
|
"$<${cxx_exceptions_property}:${cxx_exceptions_on}>"
|
||||||
"$<$<NOT:${cxx_exceptions_property}>:${cxx_exceptions_off}>")
|
"$<$<NOT:${cxx_exceptions_property}>:${cxx_exceptions_off}>")
|
||||||
|
|
||||||
|
# We should use -fvisibility=hidden everywhere, as it makes sure we think
|
||||||
|
# about what symbols really should be exposed externally. For more info, see:
|
||||||
|
# https://gcc.gnu.org/wiki/Visibility
|
||||||
|
if(NOT MSVC)
|
||||||
|
check_cxx_compiler_flag("-fvisibility=hidden" COMPILER_SUPPORTS_FVISIBILITY_HIDDEN)
|
||||||
|
if(COMPILER_SUPPORTS_FVISIBILITY_HIDDEN)
|
||||||
|
add_compile_options("-fvisibility=hidden")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# Include global modules needed for configure scripts
|
# Include global modules needed for configure scripts
|
||||||
include(PackageConfig) # Defines package_option
|
include(PackageConfig) # Defines package_option
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user