From 6147314f4749573891f70c52104a18446ff1ce61 Mon Sep 17 00:00:00 2001 From: WhiredPlanck Date: Mon, 30 Oct 2023 15:54:34 +0800 Subject: [PATCH] build: directly link glog by its namespace --- CMakeLists.txt | 5 +---- cmake/FindGlog.cmake | 26 -------------------------- src/CMakeLists.txt | 2 +- 3 files changed, 2 insertions(+), 31 deletions(-) delete mode 100644 cmake/FindGlog.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 3630168958..6a146230c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,10 +76,7 @@ if(ENABLE_LOGGING) include_directories(${Gflags_INCLUDE_PATH}) endif() - find_package(Glog REQUIRED) - if(Glog_FOUND) - include_directories(${Glog_INCLUDE_PATH}) - endif() + find_package(glog REQUIRED) if(Glog_STATIC) add_definitions(-DGOOGLE_GLOG_DLL_DECL=) endif() diff --git a/cmake/FindGlog.cmake b/cmake/FindGlog.cmake deleted file mode 100644 index d0a15c54a3..0000000000 --- a/cmake/FindGlog.cmake +++ /dev/null @@ -1,26 +0,0 @@ -set(_glog_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) - -find_path(Glog_INCLUDE_PATH glog/logging.h) - -if (Glog_STATIC) - if (WIN32) - set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES}) - else (WIN32) - set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) - endif (WIN32) -endif (Glog_STATIC) -find_library(Glog_LIBRARY NAMES glog glogd libglog) -if(Glog_INCLUDE_PATH AND Glog_LIBRARY) - set(Glog_FOUND TRUE) -endif(Glog_INCLUDE_PATH AND Glog_LIBRARY) -if(Glog_FOUND) - if(NOT Glog_FIND_QUIETLY) - message(STATUS "Found glog: ${Glog_LIBRARY}") - endif(NOT Glog_FIND_QUIETLY) -else(Glog_FOUND) - if(Glog_FIND_REQUIRED) - message(FATAL_ERROR "Could not find glog library.") - endif(Glog_FIND_REQUIRED) -endif(Glog_FOUND) - -set(CMAKE_FIND_LIBRARY_SUFFIXES ${_glog_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6364e1c8e8..b6fb970249 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -41,7 +41,7 @@ endif() set(rime_core_deps ${Boost_LIBRARIES} - ${Glog_LIBRARY} + glog::glog ${YamlCpp_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${rime_optional_deps})