diff options
author | MQueiros <maurofrqueiros@gmail.com> | 2020-10-20 16:01:37 +0100 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2020-10-21 14:29:52 -0700 |
commit | 9d5fd8357d2f00a273f3d80fb37bb07cc537a155 (patch) | |
tree | 5750380c5b00f2e0610d8ce28481c581d2363cf1 /recipes-core | |
parent | 2b9cdeb60d001ddcd034819384ea36b6b10f7208 (diff) | |
download | meta-clang-9d5fd8357d2f00a273f3d80fb37bb07cc537a155.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>
Diffstat (limited to 'recipes-core')
-rw-r--r-- | recipes-core/meta/clang-environment.inc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/recipes-core/meta/clang-environment.inc b/recipes-core/meta/clang-environment.inc index 725a431..d59bfd6 100644 --- a/recipes-core/meta/clang-environment.inc +++ b/recipes-core/meta/clang-environment.inc | |||
@@ -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 | } |