Skip to content

Commit

Permalink
Set C++ standard in accordance with iceoryx (ros2#93)
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Hoinkis <[email protected]>
  • Loading branch information
mossmaurice committed Sep 16, 2023
1 parent f80bf33 commit 41f1820
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions rmw_iceoryx_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,20 @@ if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()

# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
# Set C++ standard in accordance with iceoryx
# https://github.com/eclipse-iceoryx/iceoryx/blob/v2.0.3/iceoryx_hoofs/cmake/IceoryxPlatform.cmake#L26-L38
if(LINUX)
set(CMAKE_CXX_STANDARD 14)
elseif(QNX)
set(CMAKE_CXX_STANDARD 14)
elseif(WIN32)
set(CMAKE_CXX_STANDARD 17)
elseif(APPLE)
set(CMAKE_CXX_STANDARD 17)
elseif(UNIX)
set(CMAKE_CXX_STANDARD 17)
else()
set(CMAKE_CXX_STANDARD 17)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
Expand Down

0 comments on commit 41f1820

Please sign in to comment.