From 7b5b1dcd473098b0b89c2d516160c4ec2223df54 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 25 Jan 2020 16:01:16 +0100 Subject: [PATCH] Clang: Force absolute paths This helps with some diagnostics tools as we have various compile units in different paths. --- cmake/px4_add_common_flags.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/px4_add_common_flags.cmake b/cmake/px4_add_common_flags.cmake index 7ab11c195a..46d8b215ee 100644 --- a/cmake/px4_add_common_flags.cmake +++ b/cmake/px4_add_common_flags.cmake @@ -92,10 +92,12 @@ function(px4_add_common_flags) ) # compiler specific flags - if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang")) # force color for clang (needed for clang + ccache) add_compile_options(-fcolor-diagnostics) + # force absolute paths + add_compile_options(-fdiagnostics-absolute-paths) # QuRT 6.4.X compiler identifies as Clang but does not support this option if (NOT "${PX4_PLATFORM}" STREQUAL "qurt")