File tree 1 file changed +13
-1
lines changed
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
49
49
option (GODOT_CPP_SYSTEM_HEADERS "Expose headers as SYSTEM." ON )
50
50
option (GODOT_CPP_WARNING_AS_ERROR "Treat warnings as errors" OFF )
51
51
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
+
52
64
# Add path to modules
53
65
list ( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR} /cmake/" )
54
66
@@ -226,7 +238,7 @@ set_target_properties(${PROJECT_NAME}
226
238
PROPERTIES
227
239
CXX_EXTENSIONS OFF
228
240
POSITION_INDEPENDENT_CODE ON
229
- CXX_VISIBILITY_PRESET hidden
241
+ CXX_VISIBILITY_PRESET ${GODOT_SYMBOL_VISIBILITY}
230
242
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR} /bin"
231
243
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR} /bin"
232
244
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR} /bin"
You can’t perform that action at this time.
0 commit comments