Skip to content

Commit

Permalink
Add ${LIBGFLAGS_LIBRARY} to IMPORTED_LINK_INTERFACE_LIBRARIES of glog…
Browse files Browse the repository at this point in the history
…::glog (#9169)

Summary:
X-link: facebook/hhvm#9169

X-link: facebook/wangle#208

X-link: facebookincubator/reindeer#4

X-link: facebookincubator/velox#2445

X-link: facebookincubator/hsthrift#98

X-link: facebookincubator/katran#171

X-link: facebook/mvfst#272

X-link: facebook/fboss#118

X-link: facebookincubator/fizz#81

X-link: facebook/sapling#127

X-link: facebookarchive/sapling-staging#7

X-link: facebookexperimental/edencommon#4

X-link: facebookexperimental/rust-shed#34

X-link: facebook/fbthrift#521

X-link: facebook/watchman#1055

Pull Request resolved: #1854

X-link: facebook/openr#140

X-link: facebook/fb303#31

Previously Folly provided a polyfill of the `GflagsFlagSaver` symbol, which was removed since 4dadde1. Therefore, `glog` should solve the `GflagsFlagSaver` symbol directly 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`.

Reviewed By: alexeyt

Differential Revision: D39220438

fbshipit-source-id: 485d67bfeace955f83a4961372680f12eb9cc1a5
  • Loading branch information
Atry authored and facebook-github-bot committed Sep 7, 2022
1 parent 91a38a8 commit 0682178
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build/fbcode_builder/CMake/FindGlog.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,10 @@ 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)
message(STATUS "Found gflags as a dependency of glog::glog, include=${LIBGFLAGS_INCLUDE_DIR}, libs=${LIBGFLAGS_LIBRARY}")
set_target_properties(glog::glog PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES ${LIBGFLAGS_LIBRARY})
endif()
endif()

0 comments on commit 0682178

Please sign in to comment.