From fa8cfaa77499b5aef6d67ae507b81d450ba2e399 Mon Sep 17 00:00:00 2001 From: Peter Dillinger Date: Mon, 6 Jul 2026 14:09:03 -0700 Subject: [PATCH] Fix cmake, add learning to CLAUDE.md --- CLAUDE.md | 5 +++++ CMakeLists.txt | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 2df40f1cf5..8dc3702301 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -243,6 +243,11 @@ from an implementation detail instead of an explicit option. * Don't manually edit BUCK file, after updating src.mk, run /usr/local/bin/python3 buckifier/buckify_rocksdb.py to update it * For -j in make command, use the number of CPU cores to decide it. +* When searching for references to something (a symbol, library, etc.), do not + restrict or truncate your search based on presumed relevance or scope. It is + important and time-saving to keep the repo reasonably consistent across + different build systems, programming languages, and even between + documentation and implementation. ### Avoiding mixed build modes with Make (use `AUTO_CLEAN=1`) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c8579278b..0e280126c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -698,10 +698,19 @@ if(USE_FOLLY) include(${FOLLY_INST_PATH}/lib/cmake/folly/folly-config.cmake) - # Fix gflags library name for debug builds + # Fix gflags library name for debug builds. The getdeps gflags shared + # library is versioned (e.g. libgflags_debug.so.2.3), so resolve the + # actual file by glob rather than hard-coding a version. if(CMAKE_BUILD_TYPE STREQUAL "Debug") + file(GLOB GFLAGS_DEBUG_SHARED_LIBS + "${GFLAGS_INST_PATH}/lib/libgflags_debug.so.*") + if(NOT GFLAGS_DEBUG_SHARED_LIBS) + message(FATAL_ERROR + "Could not find getdeps libgflags_debug.so under ${GFLAGS_INST_PATH}/lib") + endif() + list(GET GFLAGS_DEBUG_SHARED_LIBS 0 GFLAGS_DEBUG_SHARED_LIB) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath=${GFLAGS_INST_PATH}/lib") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GFLAGS_INST_PATH}/lib/libgflags_debug.so.2.2") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GFLAGS_DEBUG_SHARED_LIB}") endif() endif()