Skip to content

Commit

Permalink
enforce =std=c++14 for lambda capture initializers
Browse files Browse the repository at this point in the history
realsense-viewer.cpp:69:33: warning: lambda capture initializers only available with ‘-std=c++14’ or ‘-std=gnu++14’ [-Wc++14-extensions]
   69 |                 [&viewer_model, weak_device_models = std::weak_ptr< device_models_list >( device_models ), filename](

MSVC TODO
  • Loading branch information
Reini Urban committed Apr 18, 2024
1 parent 43133ff commit 96dbd61
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions CMake/global_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
# View the makefile commands during build
#set(CMAKE_VERBOSE_MAKEFILE on)

macro(use_cxx14)
if (CMAKE_VERSION VERSION_LESS "3.1")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14")
else
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
endif()
else()
set(CMAKE_CXX_STANDARD 14)
endif()
endmacro(use_cxx14)
use_cxx14()

include(GNUInstallDirs)
# include librealsense helper macros
include(CMake/lrs_macros.cmake)
Expand Down

0 comments on commit 96dbd61

Please sign in to comment.