Skip to content

Commit bc56055

Browse files
jbeshaymeta-codesync[bot]
authored andcommitted
Fix mac getdeps build for glog > 0.7
Summary: glog 0.7+ requires the preprocessor define `GLOG_USE_GLOG_EXPORT` before including its headers. On GitHub Actions (macOS-latest), `--allow-system-packages` causes getdeps to use Homebrew's glog, which has been updated to 0.7+, breaking the fizz and mvfst builds. Add `add_compile_definitions(GLOG_USE_GLOG_EXPORT)` to fizz and mvfst CMakeLists.txt, and set `INTERFACE_COMPILE_DEFINITIONS` on the `glog::glog` target in FindGlog.cmake for any consumer using the target directly. The define is harmless on older glog versions. Reviewed By: joanna-jo Differential Revision: D92770668 fbshipit-source-id: 57ecc2b33eef149453f116cdd05a8b0363930653
1 parent c88c2db commit bc56055

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

build/fbcode_builder/CMake/FindGlog.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ if (NOT TARGET glog::glog)
3434
add_library(glog::glog UNKNOWN IMPORTED)
3535
set_target_properties(glog::glog PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${GLOG_INCLUDE_DIRS}")
3636
set_target_properties(glog::glog PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C" IMPORTED_LOCATION "${GLOG_LIBRARIES}")
37+
set_target_properties(glog::glog PROPERTIES
38+
INTERFACE_COMPILE_DEFINITIONS "GLOG_USE_GLOG_EXPORT")
3739

3840
find_package(Gflags)
3941
if(GFLAGS_FOUND)

0 commit comments

Comments
 (0)