Skip to content

Commit

Permalink
Check compile options (ros-navigation#3487)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Najjar authored Mar 17, 2023
1 parent 95dd208 commit e725903
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion nav2_mppi_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,21 @@ foreach(pkg IN LISTS dependencies_pkgs)
endforeach()

nav2_package()
add_compile_options(-O3 -mavx2 -mfma -finline-limit=1000000 -ffp-contract=fast -ffast-math)

include(CheckCXXCompilerFlag)

check_cxx_compiler_flag("-mavx2" COMPILER_SUPPORTS_AVX2)
check_cxx_compiler_flag("-mfma" COMPILER_SUPPORTS_FMA)

if(COMPILER_SUPPORTS_AVX2)
add_compile_options(-mavx2)
endif()

if(COMPILER_SUPPORTS_FMA)
add_compile_options(-mfma)
endif()

add_compile_options(-O3 -finline-limit=1000000 -ffp-contract=fast -ffast-math)

add_library(mppi_controller SHARED
src/controller.cpp
Expand Down

0 comments on commit e725903

Please sign in to comment.