Skip to content

Commit

Permalink
Set the C++ version to 17. (#761)
Browse files Browse the repository at this point in the history
Even though this is a C package, we still use C++
for the tests.  So we should set the version to C++17.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
  • Loading branch information
clalancette committed Aug 10, 2023
1 parent 89c6713 commit b854136
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rosidl_runtime_c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 11)
endif()

# Default to C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()

if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
Expand Down

0 comments on commit b854136

Please sign in to comment.