File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,18 @@ option(GENERATE_TEMPLATE_GET_NODE "Generate a template version of the Node class
4949option (GODOT_CPP_SYSTEM_HEADERS "Expose headers as SYSTEM."  ON )
5050option (GODOT_CPP_WARNING_AS_ERROR "Treat warnings as errors"  OFF )
5151
52+ set ( GODOT_SYMBOL_VISIBILITY "hidden"  CACHE  STRING  "Symbols visibility on GNU platforms. Use 'auto' to apply the default value. (auto|visible|hidden)" )
53+ set_property ( CACHE  GODOT_SYMBOL_VISIBILITY PROPERTY STRINGS  "auto;visible;hidden"  )
54+ 
55+ # CXX_VISIBILITY_PRESET supported values are: default, hidden, protected, and internal 
56+ # which is inline with the gcc -fvisibility= 
57+ # https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html 
58+ # To match the scons options we need to change the text to match the -fvisibility flag 
59+ # it is probably worth another PR which changes both to use the flag options 
60+ if ( ${GODOT_SYMBOL_VISIBILITY}  STREQUAL  "auto"  OR  ${GODOT_SYMBOL_VISIBILITY}  STREQUAL  "visible"  )
61+  set ( GODOT_SYMBOL_VISIBILITY "default"  )
62+ endif  ()
63+ 
5264# Add path to modules 
5365list ( APPEND  CMAKE_MODULE_PATH  "${CMAKE_CURRENT_SOURCE_DIR} /cmake/"  )
5466
@@ -226,7 +238,7 @@ set_target_properties(${PROJECT_NAME}
226238PROPERTIES
227239CXX_EXTENSIONS OFF 
228240POSITION_INDEPENDENT_CODE  ON 
229- CXX_VISIBILITY_PRESET hidden 
241+ CXX_VISIBILITY_PRESET ${GODOT_SYMBOL_VISIBILITY} 
230242ARCHIVE_OUTPUT_DIRECTORY  "${CMAKE_CURRENT_BINARY_DIR} /bin" 
231243LIBRARY_OUTPUT_DIRECTORY  "${CMAKE_CURRENT_BINARY_DIR} /bin" 
232244RUNTIME_OUTPUT_DIRECTORY  "${CMAKE_CURRENT_BINARY_DIR} /bin" 
                         You can’t perform that action at this time. 
           
                  
0 commit comments