diff options
author | David Snopek <dsnopek@gmail.com> | 2024-09-11 10:29:12 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-11 10:29:12 -0500 |
commit | aed9b5c7df48a6563e30f6ed78570e6fe03dc6c9 (patch) | |
tree | 7f58b615104d60896bdc43a0864ac7fc47b1c6c5 | |
parent | 4d8c05f405929480ef2eed7300447c4647da2d6f (diff) | |
parent | d18fa929fbbf6d886e9122e1de948da94c29f54f (diff) | |
download | redot-cpp-aed9b5c7df48a6563e30f6ed78570e6fe03dc6c9.tar.gz |
Merge pull request #1563 from APokorny/visibility-hidden
Add visibility-hidden to CMake build
-rw-r--r-- | CMakeLists.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index af62675..fba65b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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. @@ -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" |