From c2bb90a3f19ca13d0cd62e92e18fc086fee16794 Mon Sep 17 00:00:00 2001 From: scawful Date: Thu, 20 Nov 2025 01:13:06 -0500 Subject: [PATCH] fix(windows): add explicit Abseil include path for clang-cl compatibility When YAZE_ENABLE_GRPC=ON, Abseil comes bundled with gRPC via CPM. On Windows with Ninja + clang-cl, the Abseil include paths from the bundled targets (absl::status, absl::strings, etc.) don't always propagate correctly during compilation. This fix explicitly adds the Abseil source directory to yaze_util's include paths on Windows, ensuring clang-cl can find headers like 'absl/status/status.h', 'absl/strings/str_cat.h', etc. Fixes build failures in Windows CI that showed: fatal error: 'absl/status/status.h' file not found Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/util/util.cmake | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/util/util.cmake b/src/util/util.cmake index 0efe4a32..3fe0b416 100644 --- a/src/util/util.cmake +++ b/src/util/util.cmake @@ -46,6 +46,7 @@ target_link_libraries(yaze_util PUBLIC # When gRPC is enabled, we link to grpc++ which transitively provides Abseil # When gRPC is disabled, we use the standalone Abseil from absl.cmake if(YAZE_ENABLE_GRPC) + # Link to gRPC which provides bundled Abseil target_link_libraries(yaze_util PUBLIC grpc++ absl::status @@ -53,6 +54,23 @@ if(YAZE_ENABLE_GRPC) absl::strings absl::str_format ) + + # CRITICAL FIX FOR WINDOWS: Explicitly add Abseil include directory + # When gRPC bundles Abseil, the include paths don't always propagate correctly + # on Windows with Ninja + clang-cl. We need to explicitly add the Abseil source + # directory where headers are located. + if(WIN32) + # Get Abseil source directory from CPM or gRPC fetch + if(DEFINED absl_SOURCE_DIR) + target_include_directories(yaze_util PUBLIC ${absl_SOURCE_DIR}) + message(STATUS "Windows: Added explicit Abseil include path: ${absl_SOURCE_DIR}") + elseif(DEFINED grpc_SOURCE_DIR AND EXISTS "${grpc_SOURCE_DIR}/third_party/abseil-cpp") + target_include_directories(yaze_util PUBLIC "${grpc_SOURCE_DIR}/third_party/abseil-cpp") + message(STATUS "Windows: Added explicit Abseil include path from gRPC: ${grpc_SOURCE_DIR}/third_party/abseil-cpp") + else() + message(WARNING "Windows: Could not find Abseil source directory - build may fail") + endif() + endif() else() # Link standalone Abseil targets (configured in cmake/absl.cmake) target_link_libraries(yaze_util PUBLIC