From 3f313a774bec86c09bd8b7151288306ff615e047 Mon Sep 17 00:00:00 2001 From: fanquake Date: Fri, 24 Jul 2026 18:16:10 +0100 Subject: [PATCH] build: set CMAKE_VISIBILITY_INLINES_HIDDEN in REDUCE_EXPORTS This was originally part of the CMake switchover, but was removed because it was an addition, rather than a port. Add it now. > This switch declares that the user does not attempt to compare pointers > to inline functions or methods where the addresses of the two functions > are taken in different shared objects. > The effect of this is that GCC may, effectively, mark inline methods > with __attribute__ ((visibility ("hidden"))) so that they do not appear > in the export table of a DSO See https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html. See also https://cmake.org/cmake/help/latest/prop_tgt/VISIBILITY_INLINES_HIDDEN.html. Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ffd2da14dbc..8d67320bd53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -601,6 +601,7 @@ endif() if(REDUCE_EXPORTS) set(CMAKE_CXX_VISIBILITY_PRESET hidden) + set(CMAKE_VISIBILITY_INLINES_HIDDEN ON) try_append_linker_flag("-Wl,--exclude-libs,ALL" TARGET core_interface) try_append_linker_flag("-Wl,-no_exported_symbols" VAR CMAKE_EXE_LINKER_FLAGS) endif()