Skip to content

Commit fa0b4cf

Browse files
APokornydsnopek
authored andcommitted
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. (cherry picked from commit d18fa92)
1 parent e52b4ea commit fa0b4cf

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

@@ -222,6 +226,7 @@ set_target_properties(${PROJECT_NAME}
222226
PROPERTIES
223227
CXX_EXTENSIONS OFF
224228
POSITION_INDEPENDENT_CODE ON
229+
CXX_VISIBILITY_PRESET hidden
225230
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin"
226231
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin"
227232
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin"

0 commit comments

Comments
 (0)