summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2018-01-26 23:06:26 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-01-29 08:49:50 +0000
commite13b6f76c70ea7362f2f18371a7d1a47efe34454 (patch)
tree4327ca629ebe8aeed468165d3e89d7af8c8cf5eb /meta/classes
parent7ef064e80ccd6f7cf8df58e836d244e910c99270 (diff)
downloadpoky-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/classes')
-rw-r--r--meta/classes/meson.bbclass9
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}"
40MESON_CROSS_FILE = "" 40MESON_CROSS_FILE = ""
41MESON_CROSS_FILE_class-target = "--cross-file ${WORKDIR}/meson.cross" 41MESON_CROSS_FILE_class-target = "--cross-file ${WORKDIR}/meson.cross"
42 42
43CCOMPILER ?= "gcc"
44CXXCOMPILER ?= "g++"
45CCOMPILER_toolchain-clang = "clang"
46CXXCOMPILER_toolchain-clang = "clang++"
47
43def meson_array(var, d): 48def 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]
52c = '${HOST_PREFIX}gcc' 57c = '${HOST_PREFIX}${CCOMPILER}'
53cpp = '${HOST_PREFIX}g++' 58cpp = '${HOST_PREFIX}${CXXCOMPILER}'
54ar = '${HOST_PREFIX}ar' 59ar = '${HOST_PREFIX}ar'
55ld = '${HOST_PREFIX}ld' 60ld = '${HOST_PREFIX}ld'
56strip = '${HOST_PREFIX}strip' 61strip = '${HOST_PREFIX}strip'