From 94a54e59903c7f8da9f9f79b3e47da5822360de3 Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Fri, 17 Jan 2025 19:58:18 +0200 Subject: [PATCH] Compile with `-fvisibility=hidden`. Fixes errors when spdlog is statically linked into two shared libraries, caused by the one copy calling a function of the other. This will not cause any problems for consumers because the exported APIs are already marked with `SPDLOG_API`. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e1a4a41e..d80119e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,7 @@ endif () set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_CXX_VISIBILITY_PRESET hidden) if (CMAKE_SYSTEM_NAME MATCHES "CYGWIN" OR CMAKE_SYSTEM_NAME MATCHES "MSYS" OR CMAKE_SYSTEM_NAME MATCHES "MINGW") set(CMAKE_CXX_EXTENSIONS ON)