Skip to content

Commit 6612b45

Browse files
authored
Update rcl_logging to C++17. (#98)
The two reasons to do this are: 1. So that we can compile rcl_logging with the clang static analyzer. As of clang++-14 (what is in Ubuntu 22.04), the default still seems to be C++14, so we need to specify C++17 so that new things in the rclcpp headers work properly. 2. So we can build with a newer version of gtest which requires this. Further, due to reasons I don't fully understand, I needed to set CMAKE_CXX_STANDARD_REQUIRED in order for clang to really use that version. So set this as well. Signed-off-by: Chris Lalancette <[email protected]>
1 parent d76b545 commit 6612b45

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

rcl_logging_interface/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ project(rcl_logging_interface)
66
if(NOT CMAKE_C_STANDARD)
77
set(CMAKE_C_STANDARD 11)
88
endif()
9-
# Default to C++14
9+
# Default to C++17
1010
if(NOT CMAKE_CXX_STANDARD)
11-
set(CMAKE_CXX_STANDARD 14)
11+
set(CMAKE_CXX_STANDARD 17)
12+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1213
endif()
1314

1415
if(NOT WIN32)

rcl_logging_noop/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ project(rcl_logging_noop)
66
if(NOT CMAKE_C_STANDARD)
77
set(CMAKE_C_STANDARD 11)
88
endif()
9-
# Default to C++14
9+
# Default to C++17
1010
if(NOT CMAKE_CXX_STANDARD)
11-
set(CMAKE_CXX_STANDARD 14)
11+
set(CMAKE_CXX_STANDARD 17)
12+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1213
endif()
1314

1415
find_package(ament_cmake_ros REQUIRED)

rcl_logging_spdlog/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ project(rcl_logging_spdlog)
66
if(NOT CMAKE_C_STANDARD)
77
set(CMAKE_C_STANDARD 11)
88
endif()
9-
# Default to C++14
9+
# Default to C++17
1010
if(NOT CMAKE_CXX_STANDARD)
11-
set(CMAKE_CXX_STANDARD 14)
11+
set(CMAKE_CXX_STANDARD 17)
12+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1213
endif()
1314

1415
find_package(ament_cmake_ros REQUIRED)

0 commit comments

Comments
 (0)