Skip to content

Commit

Permalink
FindGlog: Add support for 'glogd' Debug library (#1479)
Browse files Browse the repository at this point in the history
Summary:
Glog v0.4.0 when configured with Debug build type adds a 'd' suffix to
the library file. This results in FindGlog.cmake failing to locate it.

Update FindGlog.cmake to use check for 'glogd', and use
select_library_configurations() to set GLOG_LIBRARY to the correct
found filename.

(Note: this has no effect if a non-Debug type is used.)

Pull Request resolved: facebook/folly#1479

Reviewed By: yfeldblum

Differential Revision: D24503510

Pulled By: Orvid

fbshipit-source-id: 705df05a4a3d7df2df8af3bb66c319fb044adbce
  • Loading branch information
daverigby authored and facebook-github-bot committed Oct 24, 2020
1 parent 2a9a987 commit a2f7326
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion build/fbcode_builder/CMake/FindGlog.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@
# GLOG_LIBRARIES - link these to use Glog

include(FindPackageHandleStandardArgs)
include(SelectLibraryConfigurations)

find_library(GLOG_LIBRARY glog
find_library(GLOG_LIBRARY_RELEASE glog
PATHS ${GLOG_LIBRARYDIR})
find_library(GLOG_LIBRARY_DEBUG glogd
PATHS ${GLOG_LIBRARYDIR})

find_path(GLOG_INCLUDE_DIR glog/logging.h
PATHS ${GLOG_INCLUDEDIR})

select_library_configurations(GLOG)

find_package_handle_standard_args(glog DEFAULT_MSG
GLOG_LIBRARY
GLOG_INCLUDE_DIR)
Expand Down

0 comments on commit a2f7326

Please sign in to comment.