From d2c8cc28bcbc28f8fd3300223c451bf2ddd87f65 Mon Sep 17 00:00:00 2001 From: RoboticsYY Date: Tue, 12 Nov 2019 11:38:53 +0800 Subject: [PATCH] Use modern CMake method to add compile options --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 58bb37c..92491b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,8 @@ endif() # Disable Wredundant-decls warnings since rosidl generates redundant function declarations if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wno-redundant-decls") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-redundant-decls") + add_compile_options(-Wall -Wextra -Wpedantic) endif() find_package(ament_cmake REQUIRED)