summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMQueiros <maurofrqueiros@gmail.com>2020-10-20 16:01:37 +0100
committerKhem Raj <raj.khem@gmail.com>2020-10-22 12:07:16 -0700
commiteba7c48f131d8fd5a1d840949d8ead2ecfe65edc (patch)
treeba834c4a683538b433d0f54e0b2d9c06a9cfb491
parentf76e171c27639eb329214b8eb278de595f86933e (diff)
downloadmeta-clang-eba7c48f131d8fd5a1d840949d8ead2ecfe65edc.tar.gz
Remove compiler arguments from CLANG_TIDY_EXE
cclang-tidy doesn't process compilation flags like "-mlittle-endian" and "sysroot". The current export tries to use those flags, which makes clang-tidy fail like in the following example: > $ aarch64-poky-linux-clang-tidy fibonacci.cpp -mlittle-endian --sysroot=/opt/mgu22/sysroots/aarch64-poky-linux > LLVM ERROR: CommonOptionsParser: failed to parse command-line arguments. [CommonOptionsParser]: aarch64-poky-linux-clang-tidy: Unknown command line argument '-mlittle-endian'. Try: 'aarch64-poky-linux-clan$ > aarch64-poky-linux-clang-tidy: Did you mean '--list-checks'? > aarch64-poky-linux-clang-tidy: Unknown command line argument '--sysroot=/opt/mgu22/sysroots/aarch64-poky-linux'. Try: 'aarch64-poky-linux-clang-tidy --help' > aarch64-poky-linux-clang-tidy: Did you mean '--color=/opt/mgu22/sysroots/aarch64-poky-linux'? This change removes those compiler arguments: > $ aarch64-poky-linux-clang-tidy fibonacci.cpp > Error while trying to load a compilation database: > Could not auto-detect compilation database for file "fibonacci.cpp" > No compilation database found in /home/mqueiros/workspace/minimal-working-example/fibonacci or any parent directory > fixed-compilation-database: Error while opening fixed database: No such file or directory > json-compilation-database: Error while opening JSON database: No such file or directory > Running without flags. Signed-off-by: Mauro Queiros <maurofrqueiros@gmail.com> Backported from master to dunfell branch (cherry picked from commit 9d5fd8357d2f00a273f3d80fb37bb07cc537a155). Signed-off-by: Daniel Dittmann <daniel.dittmann@rohde-schwarz.com>
-rw-r--r--recipes-core/meta/meta-environment.bbappend2
1 files changed, 1 insertions, 1 deletions
diff --git a/recipes-core/meta/meta-environment.bbappend b/recipes-core/meta/meta-environment.bbappend
index 725a431..d59bfd6 100644
--- a/recipes-core/meta/meta-environment.bbappend
+++ b/recipes-core/meta/meta-environment.bbappend
@@ -14,6 +14,6 @@ create_sdk_files_append() {
14 echo 'export CLANGCC="${TARGET_PREFIX}clang ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script 14 echo 'export CLANGCC="${TARGET_PREFIX}clang ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script
15 echo 'export CLANGCXX="${TARGET_PREFIX}clang++ ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script 15 echo 'export CLANGCXX="${TARGET_PREFIX}clang++ ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script
16 echo 'export CLANGCPP="${TARGET_PREFIX}clang -E ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script 16 echo 'export CLANGCPP="${TARGET_PREFIX}clang -E ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script
17 echo 'export CLANG_TIDY_EXE="${TARGET_PREFIX}clang-tidy ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script 17 echo 'export CLANG_TIDY_EXE="${TARGET_PREFIX}clang-tidy"' >> $script
18 fi 18 fi
19} 19}