From 6134a046cb1a20d3df527a0c3391e5ab98cf2673 Mon Sep 17 00:00:00 2001 From: Hui Wang Date: Fri, 6 Mar 2020 14:31:27 +0100 Subject: [PATCH] ignore weak symbol under mac because it must be defined --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c0d4cd5504d..2948225583c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -214,6 +214,10 @@ if (COMPILER_CLANG) # TODO investigate that set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer") + if (OS_DARWIN) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-U,_inside_main") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-U,_inside_main") + endif() endif () option (ENABLE_LIBRARIES "Enable all libraries (Global default switch)" ON)