use add_compile_options instead of setting only cxx flags

This commit is contained in:
Mikael Arguedas 2018-09-18 15:42:00 -07:00
parent e8d3fdd56c
commit f6c2f5ba0d

View file

@ -19,12 +19,7 @@ if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# we dont use add_compile_options with pedantic in message packages
# because the Python C extensions dont comply with it
# TODO(mikaelarguedas) change to add_compile_options
# once this is not a message package anymore
# https://github.com/ros2/system_tests/issues/191
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
include_directories(include)