File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1
1
cmake_minimum_required (VERSION 3.5 )
2
2
project (nav2_mppi_controller )
3
3
4
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
5
+ # Use C++20 on Apple Clang to support Concepts natively and avoid -fconcepts
6
+ set (CMAKE_CXX_STANDARD 20 )
7
+ set (CMAKE_CXX_STANDARD_REQUIRED ON )
8
+ set (CMAKE_CXX_EXTENSIONS OFF ) # Use -std=c++20, not -std=gnu++20
9
+ endif ()
10
+
4
11
find_package (ament_cmake REQUIRED )
5
12
find_package (angles REQUIRED )
6
13
find_package (backward_ros REQUIRED )
@@ -83,7 +90,12 @@ add_library(mppi_critics SHARED
83
90
src/critics/twirling_critic.cpp
84
91
src/critics/velocity_deadband_critic.cpp
85
92
)
86
- target_compile_options (mppi_critics PUBLIC -fconcepts -O3 )
93
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
94
+ # Apple Clang: use C++20 and optimization, omit -fconcepts
95
+ target_compile_options (mppi_critics PUBLIC -O3 )
96
+ else ()
97
+ target_compile_options (mppi_critics PUBLIC -fconcepts -O3 )
98
+ endif ()
87
99
target_include_directories (mppi_critics
88
100
PUBLIC
89
101
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /include>"
You can’t perform that action at this time.
0 commit comments