--- a/cartographer_ros/CMakeLists.txt +++ b/cartographer_ros/CMakeLists.txt @@ -18,6 +18,15 @@ cmake_minimum_required(VERSION 3.5) project(cartographer_ros) +# Abseil thread-safety annotation macros contain parentheses which break +# shell command-line parsing when passed via CXXFLAGS. Define them here +# via CMake so they never reach the shell. +add_compile_definitions( + "GUARDED_BY(x)=" + "EXCLUSIVE_LOCKS_REQUIRED(x)=" + "GUARDED_BY_CONTENTION(x)=" + "SHARED_LOCKS_REQUIRED(x)=" +) + find_package(ament_cmake REQUIRED) # Default to C++17