Skip to content

Commit d18fa92

Browse files
committed
Add visibility-hidden
This should make all symbols that are not marked otherwise have hidden visibility. There still may be exposed symbols if marked with respective attributes.
1 parent 19c83a8 commit d18fa92

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
# Generate the buildfiles in a sub directory to not clutter the root directory with build files:
3636
# mkdir build && cd build && cmake -G "Unix Makefiles" .. && cmake --build .
3737
#
38+
# Ensure that you avoid exposing godot-cpp symbols - this might lead to hard to debug errors if you ever load multiple
39+
# plugins using difference godot-cpp versions. Use visibility hidden whenever possible:
40+
# set_target_properties(<all-my-plugin-related-targets> PROPERTIES CXX_VISIBILITY_PRESET hidden)
41+
#
3842
# Todo
3943
# Test build for Windows, Mac and mingw.
4044

@@ -221,6 +225,7 @@ set_target_properties(${PROJECT_NAME}
221225
PROPERTIES
222226
CXX_EXTENSIONS OFF
223227
POSITION_INDEPENDENT_CODE ON
228+
CXX_VISIBILITY_PRESET hidden
224229
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin"
225230
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin"
226231
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin"

0 commit comments

Comments
 (0)