From e670e34a9a3576e71923d93985e0218ef2af4dfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Wed, 24 Aug 2022 08:24:03 +0700 Subject: [PATCH] C{,XX}FLAGS: change -fdebug-prefix-map for cmake and meson Both of them build inside a builddir. This change ease the debugging process. --- .../configure/debug-debug-prefix-map.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/common/environment/configure/debug-debug-prefix-map.sh b/common/environment/configure/debug-debug-prefix-map.sh index ca30b61b79ab..b2e187dd407e 100644 --- a/common/environment/configure/debug-debug-prefix-map.sh +++ b/common/environment/configure/debug-debug-prefix-map.sh @@ -1,2 +1,13 @@ -CFLAGS="${CFLAGS} -fdebug-prefix-map=$wrksrc=." -CXXFLAGS="${CXXFLAGS} -fdebug-prefix-map=$wrksrc=." +case "$build_style" in +cmake) + CFLAGS="${CFLAGS} -fdebug-prefix-map=$wrksrc/${cmake_builddir:-build}=." + CXXFLAGS="${CXXFLAGS} -fdebug-prefix-map=$wrksrc/${cmake_builddir:-build}=." + ;; +meson) + CFLAGS="${CFLAGS} -fdebug-prefix-map=$wrksrc/${meson_builddir:-build}=." + CXXFLAGS="${CXXFLAGS} -fdebug-prefix-map=$wrksrc/${meson_builddir:-build}=." + ;; +*) + CFLAGS="${CFLAGS} -fdebug-prefix-map=$wrksrc=." + CXXFLAGS="${CXXFLAGS} -fdebug-prefix-map=$wrksrc=." +esac