Skip to content

Commit aed9b5c

Browse files
authored
Merge pull request godotengine#1563 from APokorny/visibility-hidden
Add visibility-hidden to CMake build
2 parents 4d8c05f + d18fa92 commit aed9b5c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: CMakeLists.txt

+5
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)