From 8ee31852f2d7999dce8e290a612127e2049c2ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Sun, 21 Jun 2026 07:02:50 -0400 Subject: [PATCH] abseil: disable CMAKE_INCLUDE_CURRENT_DIR for the in-tree build A consumer (e.g. ossia score) that enables CMAKE_INCLUDE_CURRENT_DIR makes CMake add each target's own source/binary dir as a plain -I. For Abseil's absl/time target this injects -I.../absl/time, whose time.h then shadows the system C (reached e.g. via pthread.h's #include ). The build then fails with: error: no member named 'clock_t' in the global namespace Abseil includes its own headers as absl/... and does not rely on CMAKE_INCLUDE_CURRENT_DIR, so disabling it inside the existing block() scope is safe and limited to the Abseil subtree. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_017UXxiAmZEiEqjGUJhXkCpX --- cmake/deps/abseil.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmake/deps/abseil.cmake b/cmake/deps/abseil.cmake index bfa14ebebee..b1979b71036 100644 --- a/cmake/deps/abseil.cmake +++ b/cmake/deps/abseil.cmake @@ -15,6 +15,14 @@ if(NOT TARGET absl::strings) # get flooded with warnings coming from them. set(ABSL_USE_SYSTEM_INCLUDES ON CACHE INTERNAL "") + # A consumer with CMAKE_INCLUDE_CURRENT_DIR enabled would otherwise add each + # Abseil target's own source/binary dir as a plain -I. For the absl/time + # target that injects -I.../absl/time, whose time.h then shadows the system + # C (e.g. when pthread.h does #include ), breaking the + # build with "no member named 'clock_t' in the global namespace" errors. + # Abseil includes its own headers as absl/... so it does not need this. + set(CMAKE_INCLUDE_CURRENT_DIR OFF) + # Abseil's CMakeLists forcibly overrides CMAKE_MSVC_RUNTIME_LIBRARY from its # own ABSL_MSVC_STATIC_RUNTIME option (default OFF -> /MD), ignoring what the # rest of the build selected. Static ossia builds (Max/PD/Python/Unity, ...)