From c6e608e921b3c2a352dcf91247f10032924d1e5c Mon Sep 17 00:00:00 2001 From: Olivier BICHLER <olivier.bichler@cea.fr> Date: Tue, 3 Oct 2023 10:08:41 +0200 Subject: [PATCH] Put -fvisibility=hidden as PUBLIC --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fe353a650..40d8837f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,9 +66,13 @@ endif() target_compile_features(${module_name} PRIVATE cxx_std_14) +# -fvisibility=hidden required by pybind11 +target_compile_options(${module_name} PUBLIC + $<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>: + -fvisibility=hidden>) target_compile_options(${module_name} PRIVATE $<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>: - -Wall -Wextra -Wold-style-cast -Winline -pedantic -Werror=narrowing -fvisibility=hidden -Wshadow $<$<BOOL:${WERROR}>:-Werror>>) + -Wall -Wextra -Wold-style-cast -Winline -pedantic -Werror=narrowing -Wshadow $<$<BOOL:${WERROR}>:-Werror>>) target_compile_options(${module_name} PRIVATE $<$<CXX_COMPILER_ID:MSVC>: /W4>) -- GitLab