From 7daa8f52a9d2f99c58fb3678b0568f51ccfe51f8 Mon Sep 17 00:00:00 2001 From: Katie Mancini Date: Fri, 10 Nov 2023 17:06:57 -0800 Subject: [PATCH] fix getdeps build: gflags-NOTFOUND Summary: When gflags is installed on the system the edencommon getdeps build fails with ``` ninja: error: 'gflags-NOTFOUND', needed by 'eden/common/utils/test/process_info_cache_test', missing and no known rule to make it ``` There is more context above the error: ``` IMPORTED_LOCATION not set for imported target "gflags" configuration "RelWithDebInfo". ``` So the issue is that IMPORTED_LOCATION is not set for gflags. We do explicitly set IMPORTED_LOCATION in certain cases in FindGflags: https://github.com/facebook/folly/blob/main/build/fbcode_builder/CMake/FindGflags.cmake#L102 I see in the log that gflags get's found twice: ``` -- Found gflags from package config /usr/lib64/cmake/gflags/gflags-config.cmake -- Found Glog: /usr/lib64/libglog.so -- Found gflags as a dependency of glog::glog, include=/usr/include, libs=gflags ``` I think the gflags found as a dep of glog maybe doesn't trigger IMPORTED_LOCATION to be set correctly. Not really sure why. But flipping the order of the imports seems to unbreak the build. For now that will do to unblock. fixes #1163 Reviewed By: chadaustin Differential Revision: D51220413 fbshipit-source-id: 682dd2fba8d6993c5936b141a8a0e488b03e6cfd --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cdb76e64..62cffe24 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,12 +41,12 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" "${CMAKE_CURRENT_SOURCE_DIR}/build/fbcode_builder/CMake" ${CMAKE_MODULE_PATH}) -find_package(Gflags REQUIRED) -include_directories(${GFLAGS_INCLUDE_DIR}) - find_package(Glog MODULE REQUIRED) include_directories(${GLOG_INCLUDE_DIR}) +find_package(Gflags REQUIRED) +include_directories(${GFLAGS_INCLUDE_DIR}) + find_package(folly CONFIG REQUIRED) include_directories(${FOLLY_INCLUDE_DIR})