From 0fecbac4965705a5fb04613ee011bd39e2875d14 Mon Sep 17 00:00:00 2001 From: Leander Schulten Date: Fri, 14 Jul 2023 01:05:44 +0200 Subject: [PATCH 1/4] Simplyfy c++ version check --- CMake/lrs_macros.cmake | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) 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 5c72d05d3f612a95ea5c62d43009969c064a5e83 Mon Sep 17 00:00:00 2001 From: Leander Schulten Date: Mon, 17 Jul 2023 00:48:18 +0200 Subject: [PATCH 2/4] 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 c72a912e39..61b4f6cf91 100644 --- a/third-party/rsutils/CMakeLists.txt +++ b/third-party/rsutils/CMakeLists.txt @@ -6,6 +6,7 @@ project( rsutils ) add_library( ${PROJECT_NAME} STATIC "" ) # We cannot directly interface with nlohmann_json (doesn't work on bionic) #target_link_libraries( ${PROJECT_NAME} PUBLIC nlohmann_json ) +target_compile_features( ${PROJECT_NAME} PUBLIC cxx_std_11 ) set_target_properties( ${PROJECT_NAME} PROPERTIES FOLDER Library ) target_include_directories( ${PROJECT_NAME} From fb961c2fae53047a44013404386d94e8db76a212 Mon Sep 17 00:00:00 2001 From: Leander Schulten Date: Mon, 17 Jul 2023 00:57:00 +0200 Subject: [PATCH 3/4] 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} From be4679ece0c0874110eb5352cef4cd1d0f752152 Mon Sep 17 00:00:00 2001 From: Eran Date: Sun, 12 May 2024 19:03:02 +0300 Subject: [PATCH 4/4] change rsutils to C++14 --- third-party/rsutils/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party/rsutils/CMakeLists.txt b/third-party/rsutils/CMakeLists.txt index 61b4f6cf91..b0fc310497 100644 --- a/third-party/rsutils/CMakeLists.txt +++ b/third-party/rsutils/CMakeLists.txt @@ -6,7 +6,7 @@ project( rsutils ) add_library( ${PROJECT_NAME} STATIC "" ) # We cannot directly interface with nlohmann_json (doesn't work on bionic) #target_link_libraries( ${PROJECT_NAME} PUBLIC nlohmann_json ) -target_compile_features( ${PROJECT_NAME} PUBLIC cxx_std_11 ) +target_compile_features( ${PROJECT_NAME} PUBLIC cxx_std_14 ) set_target_properties( ${PROJECT_NAME} PROPERTIES FOLDER Library ) target_include_directories( ${PROJECT_NAME}