diff options
author | Khem Raj <raj.khem@gmail.com> | 2018-01-26 23:06:26 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-01-29 08:49:50 +0000 |
commit | e13b6f76c70ea7362f2f18371a7d1a47efe34454 (patch) | |
tree | 4327ca629ebe8aeed468165d3e89d7af8c8cf5eb /meta | |
parent | 7ef064e80ccd6f7cf8df58e836d244e910c99270 (diff) | |
download | poky-e13b6f76c70ea7362f2f18371a7d1a47efe34454.tar.gz |
meson: Adjust for clang compiler
Remove hardcoding c/c++ compiler to be gcc alone, its
possible to use clang as replacement for cross compilers
from meta-clang, therefore set clang/clang++ if
TOOLCHAIN = "clang"
(From OE-Core rev: 05789489d25a5ceac0403613ad789d78198be6ee)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/meson.bbclass | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass index 91ac652651..cd3497a802 100644 --- a/meta/classes/meson.bbclass +++ b/meta/classes/meson.bbclass | |||
@@ -40,6 +40,11 @@ EXTRA_OEMESON += "${PACKAGECONFIG_CONFARGS}" | |||
40 | MESON_CROSS_FILE = "" | 40 | MESON_CROSS_FILE = "" |
41 | MESON_CROSS_FILE_class-target = "--cross-file ${WORKDIR}/meson.cross" | 41 | MESON_CROSS_FILE_class-target = "--cross-file ${WORKDIR}/meson.cross" |
42 | 42 | ||
43 | CCOMPILER ?= "gcc" | ||
44 | CXXCOMPILER ?= "g++" | ||
45 | CCOMPILER_toolchain-clang = "clang" | ||
46 | CXXCOMPILER_toolchain-clang = "clang++" | ||
47 | |||
43 | def meson_array(var, d): | 48 | def meson_array(var, d): |
44 | return "', '".join(d.getVar(var).split()).join(("'", "'")) | 49 | return "', '".join(d.getVar(var).split()).join(("'", "'")) |
45 | 50 | ||
@@ -49,8 +54,8 @@ do_write_config() { | |||
49 | # This needs to be Py to split the args into single-element lists | 54 | # This needs to be Py to split the args into single-element lists |
50 | cat >${WORKDIR}/meson.cross <<EOF | 55 | cat >${WORKDIR}/meson.cross <<EOF |
51 | [binaries] | 56 | [binaries] |
52 | c = '${HOST_PREFIX}gcc' | 57 | c = '${HOST_PREFIX}${CCOMPILER}' |
53 | cpp = '${HOST_PREFIX}g++' | 58 | cpp = '${HOST_PREFIX}${CXXCOMPILER}' |
54 | ar = '${HOST_PREFIX}ar' | 59 | ar = '${HOST_PREFIX}ar' |
55 | ld = '${HOST_PREFIX}ld' | 60 | ld = '${HOST_PREFIX}ld' |
56 | strip = '${HOST_PREFIX}strip' | 61 | strip = '${HOST_PREFIX}strip' |