From 7eaa556f55a3b7bb0c9d905900cc100107972f07 Mon Sep 17 00:00:00 2001 From: Amos Bird Date: Thu, 12 Dec 2019 02:08:09 +0800 Subject: [PATCH] Fix clang build --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 59a4dfe6ab..68523d0ae2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -206,6 +206,13 @@ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILER_FLAGS} ${C set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O3 ${CMAKE_C_FLAGS_ADD}") set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g3 -ggdb3 -fno-inline ${CMAKE_C_FLAGS_ADD}") +if (COMPILER_CLANG) + # Exception unwinding doesn't work in clang release build without this option + # TODO investigate if contrib/libcxxabi is out of date + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer") +endif () + option (ENABLE_LIBRARIES "Enable all libraries (Global default switch)" ON) option (UNBUNDLED "Try find all libraries in system. We recommend to avoid this mode for production builds, because we cannot guarantee exact versions and variants of libraries your system has installed. This mode exists for enthusiastic developers who search for trouble. Also it is useful for maintainers of OS packages." OFF)