use CMAKE_X_STANDARD and check compiler rather than platform
This commit is contained in:
parent
f396ff2bac
commit
756ef6886d
2 changed files with 17 additions and 8 deletions
|
@ -2,10 +2,12 @@ cmake_minimum_required(VERSION 3.5)
|
|||
|
||||
project(rclcpp_lifecycle)
|
||||
|
||||
if(WIN32)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -Wextra -Wpedantic")
|
||||
# Default to C++14
|
||||
if(NOT CMAKE_CXX_STANDARD)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
endif()
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
add_compile_options(-Wall -Wextra -Wpedantic)
|
||||
endif()
|
||||
|
||||
find_package(ament_cmake REQUIRED)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue