summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Bayer <tobiasbayer@outlook.de>2021-01-21 21:22:21 +0100
committerKhem Raj <raj.khem@gmail.com>2021-01-25 15:38:12 -0800
commitdca6dd429d046000ec8649ed57dca5193aeb6252 (patch)
tree33227ce225129247d3b6cb3c8765834371eac7e1
parente2d2a029ee122b9cf25f8296c6ce610bf6bebbf6 (diff)
downloadmeta-clang-dca6dd429d046000ec8649ed57dca5193aeb6252.tar.gz
Add the target option to the CLANG environment variables.
This commit fixes an issue when building a cmake based project where clang-tidy is configured as co-compiler. Without this option clang-tidy will fail as it cannot determinate the target architecture. Signed-off-by: Tobias Bayer <tobiasbayer@outlook.de>
-rw-r--r--recipes-core/meta/clang-environment.inc6
1 files changed, 3 insertions, 3 deletions
diff --git a/recipes-core/meta/clang-environment.inc b/recipes-core/meta/clang-environment.inc
index d59bfd6..a238e49 100644
--- a/recipes-core/meta/clang-environment.inc
+++ b/recipes-core/meta/clang-environment.inc
@@ -11,9 +11,9 @@ TARGET_CLANGCC_ARCH_remove_powerpc = "-mno-spe"
11create_sdk_files_append() { 11create_sdk_files_append() {
12 script=${SDK_OUTPUT}/${SDKPATH}/environment-setup-${REAL_MULTIMACH_TARGET_SYS} 12 script=${SDK_OUTPUT}/${SDKPATH}/environment-setup-${REAL_MULTIMACH_TARGET_SYS}
13 if ${@bb.utils.contains('CLANGSDK', '1', 'true', 'false', d)}; then 13 if ${@bb.utils.contains('CLANGSDK', '1', 'true', 'false', d)}; then
14 echo 'export CLANGCC="${TARGET_PREFIX}clang ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script 14 echo 'export CLANGCC="${TARGET_PREFIX}clang --target=${TARGET_SYS} ${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=${TARGET_SYS} ${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=${TARGET_SYS} ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script
17 echo 'export CLANG_TIDY_EXE="${TARGET_PREFIX}clang-tidy"' >> $script 17 echo 'export CLANG_TIDY_EXE="${TARGET_PREFIX}clang-tidy"' >> $script
18 fi 18 fi
19} 19}