Skip to content

Commit

Permalink
fix getdeps build: gflags-NOTFOUND
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Katie Mancini authored and facebook-github-bot committed Nov 11, 2023
1 parent c363c13 commit 7daa8f5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down

0 comments on commit 7daa8f5

Please sign in to comment.