You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kvrocks.apache.org by tw...@apache.org on 2022/11/05 15:44:00 UTC

[incubator-kvrocks] branch unstable updated: Improve libunwind linking in CMake (#1079)

This is an automated email from the ASF dual-hosted git repository.

twice pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/incubator-kvrocks.git


The following commit(s) were added to refs/heads/unstable by this push:
     new 4bb27646 Improve libunwind linking in CMake (#1079)
4bb27646 is described below

commit 4bb276462396f9afb2506873783aa81fdaef6d22
Author: Twice <tw...@gmail.com>
AuthorDate: Sat Nov 5 23:43:54 2022 +0800

    Improve libunwind linking in CMake (#1079)
---
 CMakeLists.txt   | 6 +-----
 cmake/glog.cmake | 1 +
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6e484c6b..e9b48716 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,6 +27,7 @@ option(ASAN_WITH_LSAN "enable leak santinizer while address santinizer is enable
 option(ENABLE_STATIC_LIBSTDCXX "link kvrocks with static library of libstd++ instead of shared library" ON)
 option(USE_LUAJIT "use luaJIT instead of lua" OFF)
 option(ENABLE_OPENSSL "enable openssl to support tls connection" OFF)
+option(ENABLE_UNWIND "enable libunwind in glog" ON)
 
 if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
     cmake_policy(SET CMP0135 NEW)
@@ -163,8 +164,6 @@ if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR (CMAKE_CXX_COMPILER_ID STREQUAL "C
     endif()
 endif()
 
-find_library(FOUND_UNWIND_LIB unwind)
-
 # kvrocks objects target
 file(GLOB_RECURSE KVROCKS_SRCS src/*.cc)
 list(FILTER KVROCKS_SRCS EXCLUDE REGEX src/main.cc)
@@ -181,9 +180,6 @@ elseif((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQU
 endif()
 target_link_libraries(kvrocks_objs PUBLIC -fno-omit-frame-pointer)
 target_link_libraries(kvrocks_objs PUBLIC ${EXTERNAL_LIBS})
-if(FOUND_UNWIND_LIB)
-    target_link_libraries(kvrocks_objs PUBLIC ${FOUND_UNWIND_LIB})
-endif()
 if(ENABLE_OPENSSL)
     target_compile_definitions(kvrocks_objs PUBLIC ENABLE_OPENSSL)
 endif()
diff --git a/cmake/glog.cmake b/cmake/glog.cmake
index 5e9c1268..4a29a589 100644
--- a/cmake/glog.cmake
+++ b/cmake/glog.cmake
@@ -28,4 +28,5 @@ FetchContent_MakeAvailableWithArgs(glog
   WITH_GFLAGS=OFF
   WITH_GTEST=OFF
   BUILD_SHARED_LIBS=OFF
+  WITH_UNWIND=${ENABLE_UNWIND}
 )