diff --git a/cmake/MujocoDependencies.cmake b/cmake/MujocoDependencies.cmake index fd9bba83..b48537fc 100644 --- a/cmake/MujocoDependencies.cmake +++ b/cmake/MujocoDependencies.cmake @@ -278,6 +278,9 @@ if(MUJOCO_BUILD_TESTS OR MUJOCO_BUILD_STUDIO OR MUJOCO_USE_FILAMENT) CACHE INTERNAL "Build tests." ) + set(ABSL_PATCH_COMMAND + git apply --reject --whitespace=fix ${mujoco_SOURCE_DIR}/cmake/abseil-cpp-source_location.patch + ) set(ABSL_BUILD_TESTING OFF) findorfetch( USE_SYSTEM_PACKAGE @@ -293,6 +296,8 @@ if(MUJOCO_BUILD_TESTS OR MUJOCO_BUILD_STUDIO OR MUJOCO_USE_FILAMENT) TARGETS absl::core_headers EXCLUDE_FROM_ALL + PATCH_COMMAND + ${ABSL_PATCH_COMMAND} ) set(BUILD_TESTING diff --git a/cmake/abseil-cpp-source_location.patch b/cmake/abseil-cpp-source_location.patch new file mode 100644 index 00000000..84655612 --- /dev/null +++ b/cmake/abseil-cpp-source_location.patch @@ -0,0 +1,11 @@ +diff --git a/absl/base/options.h b/absl/base/options.h +--- a/absl/base/options.h ++++ b/absl/base/options.h +@@ -99,6 +99,6 @@ + // the source location type is an alias of std::source_location type, use the + // feature macro ABSL_USES_STD_SOURCE_LOCATION. + // +-#define ABSL_OPTION_USE_STD_SOURCE_LOCATION 2 ++#define ABSL_OPTION_USE_STD_SOURCE_LOCATION 0 + + // ABSL_OPTION_USE_STD_ORDERING