Skip to content

Commit

Permalink
Patch librealsense v2.44.0 to include <chrono> for system_clock
Browse files Browse the repository at this point in the history
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
  • Loading branch information
StephanTLavavej committed Nov 23, 2024
1 parent b65896f commit 469ce85
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions 3rdparty/librealsense/fix-include-chrono.patch
Original file line number Diff line number Diff line change
@@ -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 <memory> // For shared_ptr
#include <functional> // For function
+#include <chrono>
#include <thread> // For this_thread::sleep_for
#include <vector>
#include <algorithm>
3 changes: 3 additions & 0 deletions 3rdparty/librealsense/librealsense.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 <chrono> 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=<INSTALL_DIR>
-DBUILD_SHARED_LIBS=OFF
Expand Down

0 comments on commit 469ce85

Please sign in to comment.