Skip to content

Add compiler standards #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ros2_control_cmake/cmake/ros2_control.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ macro(set_compiler_options)
-Werror=missing-braces)
message(STATUS "Compiler warnings enabled for ${CMAKE_CXX_COMPILER_ID}")

# https://docs.ros.org/en/rolling/How-To-Guides/Ament-CMake-Documentation.html#compiler-and-linker-options
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()

# Extract major version if g++ is used
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
extract_gcc_version()
Expand Down
Loading