From 469ce857249dd9c38226ea73e114ec567fdfd038 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Fri, 22 Nov 2024 16:16:52 -0800 Subject: [PATCH] Patch librealsense v2.44.0 to include `` for `system_clock` Fixes: C:\gitP\isl-org\Open3D\build_amd64\librealsense\src\ext_librealsense\src\backend.h(108,79): error C2039: 'system_clock': is not a member of 'std::chrono' And cascaded: C:\gitP\isl-org\Open3D\build_amd64\librealsense\src\ext_librealsense\src\backend.cpp(28,88): error C2039: 'system_clock': is not a member of 'std::chrono' C:\gitP\isl-org\Open3D\build_amd64\librealsense\src\ext_librealsense\src\mf\mf-backend.h(31,26): error C2039: 'high_resolution_clock': is not a member of 'std::chrono' C:\gitP\isl-org\Open3D\build_amd64\librealsense\src\ext_librealsense\src\mf\mf-backend.cpp(26,9): error C2512: 'std::chrono::time_point': no appropriate default constructor available --- 3rdparty/librealsense/fix-include-chrono.patch | 12 ++++++++++++ 3rdparty/librealsense/librealsense.cmake | 3 +++ 2 files changed, 15 insertions(+) create mode 100644 3rdparty/librealsense/fix-include-chrono.patch diff --git a/3rdparty/librealsense/fix-include-chrono.patch b/3rdparty/librealsense/fix-include-chrono.patch new file mode 100644 index 00000000000..fe3ea80b784 --- /dev/null +++ b/3rdparty/librealsense/fix-include-chrono.patch @@ -0,0 +1,12 @@ +diff --git a/src/backend.h b/src/backend.h +index a402e3dfb..0acd299c0 100644 +--- a/src/backend.h ++++ b/src/backend.h +@@ -14,6 +14,7 @@ + + #include // For shared_ptr + #include // For function ++#include + #include // For this_thread::sleep_for + #include + #include diff --git a/3rdparty/librealsense/librealsense.cmake b/3rdparty/librealsense/librealsense.cmake index e5caa700df7..8c4e98b57e6 100644 --- a/3rdparty/librealsense/librealsense.cmake +++ b/3rdparty/librealsense/librealsense.cmake @@ -20,6 +20,9 @@ ExternalProject_Add( # Patch for macOS ARM64 support for versions < 2.50.0 COMMAND ${GIT_EXECUTABLE} apply --ignore-space-change --ignore-whitespace ${CMAKE_CURRENT_LIST_DIR}/fix-macos-arm64.patch + # Patch to include the header for the system_clock type + COMMAND ${GIT_EXECUTABLE} apply --ignore-space-change --ignore-whitespace + ${CMAKE_CURRENT_LIST_DIR}/fix-include-chrono.patch CMAKE_ARGS -DCMAKE_INSTALL_PREFIX= -DBUILD_SHARED_LIBS=OFF