[realsense2] fix osx build (#32585)

This commit is contained in:
autoantwort 2023-07-17 22:09:34 +02:00 committed by GitHub
parent f11cac522a
commit 04adf7a7aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 81 additions and 1 deletions

View File

@ -0,0 +1,73 @@
diff --git a/CMake/lrs_macros.cmake b/CMake/lrs_macros.cmake
index b19a729049..cabb376c97 100644
--- a/CMake/lrs_macros.cmake
+++ b/CMake/lrs_macros.cmake
@@ -7,21 +7,10 @@ macro(infoValue variableName)
endmacro()
macro(config_cxx_flags)
- include(CheckCXXCompilerFlag)
- if(MSVC OR MSVC_IDE)
- check_cxx_compiler_flag(/std:c++14 SUPPORTS_CXX14)
- else()
- check_cxx_compiler_flag(-std=c++14 SUPPORTS_CXX14)
- endif()
- if( NOT SUPPORTS_CXX14 )
- message(FATAL_ERROR "Project '${PROJECT_NAME}' requires C++14 or higher")
- endif()
- if( NOT CMAKE_CXX_STANDARD )
- set( CMAKE_CXX_STANDARD 14 )
- endif()
# We require that the current project (e.g., librealsense) use C++14. However, projects using
# the library don't need to be C++14 -- they can use C++11. Hence this is PRIVATE and not PUBLIC:
- target_compile_features( ${PROJECT_NAME} PRIVATE cxx_std_${CMAKE_CXX_STANDARD} )
+ target_compile_features( ${PROJECT_NAME} PRIVATE cxx_std_14 )
+ target_compile_features( ${PROJECT_NAME} INTERFACE cxx_std_11 )
#set( CMAKE_CUDA_STANDARD ${LRS_CXX_STANDARD} )
endmacro()
From b049865e918c44833c5f6ea293b5ae1ccdea99e2 Mon Sep 17 00:00:00 2001
From: Leander Schulten <Leander.Schulten@rwth-aachen.de>
Date: Mon, 17 Jul 2023 00:48:18 +0200
Subject: [PATCH 2/3] rsutils: specify required c++ version
---
third-party/rsutils/CMakeLists.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/third-party/rsutils/CMakeLists.txt b/third-party/rsutils/CMakeLists.txt
index f6a0e41141..b31e684c43 100644
--- a/third-party/rsutils/CMakeLists.txt
+++ b/third-party/rsutils/CMakeLists.txt
@@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.8.0) # source_group(TREE)
project( rsutils )
add_library( ${PROJECT_NAME} STATIC "" )
+target_compile_features( ${PROJECT_NAME} PUBLIC cxx_std_11 )
set_target_properties( ${PROJECT_NAME} PROPERTIES FOLDER Library )
target_include_directories( ${PROJECT_NAME}
From eaa61985dd54e88e943fc433264b1161c4482593 Mon Sep 17 00:00:00 2001
From: Leander Schulten <Leander.Schulten@rwth-aachen.de>
Date: Mon, 17 Jul 2023 00:57:00 +0200
Subject: [PATCH 3/3] realsense-file: specify required c++ version
---
third-party/realsense-file/CMakeLists.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/third-party/realsense-file/CMakeLists.txt b/third-party/realsense-file/CMakeLists.txt
index a805cddf8c..63c3526b1d 100644
--- a/third-party/realsense-file/CMakeLists.txt
+++ b/third-party/realsense-file/CMakeLists.txt
@@ -27,6 +27,8 @@ add_library(${PROJECT_NAME} STATIC
${SOURCE_FILES_COMPRESSION}
)
+target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11)
+
target_include_directories(${PROJECT_NAME} PRIVATE
${ROSBAG_HEADER_DIRS}
${LZ4_INCLUDE_PATH}

View File

@ -6,6 +6,7 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
fix_openni2.patch
fix-osx.patch # from https://github.com/IntelRealSense/librealsense/pull/11997
)
file(COPY "${SOURCE_PATH}/src/win7/drivers/IntelRealSense_D400_series_win7.inf" DESTINATION "${SOURCE_PATH}")

View File

@ -1,6 +1,7 @@
{
"name": "realsense2",
"version": "2.54.1",
"port-version": 1,
"description": "Intel® RealSense™ SDK 2.0 is a cross-platform library for Intel® RealSense™ depth cameras (D400 series and the SR300).",
"homepage": "https://github.com/IntelRealSense/librealsense",
"license": "Apache-2.0",

View File

@ -7110,7 +7110,7 @@
},
"realsense2": {
"baseline": "2.54.1",
"port-version": 0
"port-version": 1
},
"recast": {
"baseline": "deprecated",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "29719e1172d7bb950bc88a29ba009e4c4c2d5f27",
"version": "2.54.1",
"port-version": 1
},
{
"git-tree": "ba09c586ba854502c24f6abf1b3307e964c8ae16",
"version": "2.54.1",