summaryrefslogtreecommitdiff
path: root/cartographer-ros-fix-absl-macros.patch
blob: 9442cdcf5187457084349177c2feed840f74311b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--- 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