From 01a20daca15cb53091e3c3953dfb4daa7c5d2162 Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Thu, 1 Sep 2022 15:09:29 -0700 Subject: [PATCH] set IMPORTED_LINK_INTERFACE_LIBRARIES to ${LIBGFLAGS_LIBRARY} for glog::glog (#31) Summary: X-link: https://github.com/facebook/fb303/pull/31 Previously Folly provided a polyfill of the `GflagsFlagSaver` symbol, which was removed since https://github.com/facebook/folly/commit/4dadde1256f74e756510a499c86459967f78afb9. Therefore, the `glog` should solve the `GflagsFlagSaver` symbol from `gflags`. This diff added `gflags` libraries as a dependency of the CMake project `glog::glog` into `fbcode_builder`'s `FindGlog.cmake`, so that the `fbcode_builder` users will be able to automatically link with `gflags`. Differential Revision: D39220438 fbshipit-source-id: d269c8e50ed20541054ea706394450043f8181ef --- build/fbcode_builder/CMake/FindGlog.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/fbcode_builder/CMake/FindGlog.cmake b/build/fbcode_builder/CMake/FindGlog.cmake index 898a8adc7..3b9e76e52 100644 --- a/build/fbcode_builder/CMake/FindGlog.cmake +++ b/build/fbcode_builder/CMake/FindGlog.cmake @@ -34,4 +34,9 @@ if (NOT TARGET glog::glog) add_library(glog::glog UNKNOWN IMPORTED) set_target_properties(glog::glog PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${GLOG_INCLUDE_DIRS}") set_target_properties(glog::glog PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C" IMPORTED_LOCATION "${GLOG_LIBRARIES}") + + find_package(Gflags) + if(GFLAGS_FOUND) + set_target_properties(glog::glog PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES ${LIBGFLAGS_LIBRARY}) + endif() endif()