Skip to content

Commit

Permalink
Merge pull request #1563 from APokorny/visibility-hidden
Browse files Browse the repository at this point in the history
Add visibility-hidden to CMake build
  • Loading branch information
dsnopek authored Sep 11, 2024
2 parents 4d8c05f + d18fa92 commit aed9b5c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
# Generate the buildfiles in a sub directory to not clutter the root directory with build files:
# mkdir build && cd build && cmake -G "Unix Makefiles" .. && cmake --build .
#
# Ensure that you avoid exposing godot-cpp symbols - this might lead to hard to debug errors if you ever load multiple
# plugins using difference godot-cpp versions. Use visibility hidden whenever possible:
# set_target_properties(<all-my-plugin-related-targets> PROPERTIES CXX_VISIBILITY_PRESET hidden)
#
# Todo
# Test build for Windows, Mac and mingw.

Expand Down Expand Up @@ -222,6 +226,7 @@ set_target_properties(${PROJECT_NAME}
PROPERTIES
CXX_EXTENSIONS OFF
POSITION_INDEPENDENT_CODE ON
CXX_VISIBILITY_PRESET hidden
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin"
Expand Down

0 comments on commit aed9b5c

Please sign in to comment.