summaryrefslogtreecommitdiffstats
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:45 +0000
commit05789489d25a5ceac0403613ad789d78198be6ee (patch)
treece4f29642ddf3fe3613b79f802880fcefa7ff27d
parent9f2de4f9cf1eb6de75dc789bd0549f45c7a68c55 (diff)
downloadopenembedded-core-contrib-05789489d25a5ceac0403613ad789d78198be6ee.tar.gz
openembedded-core-contrib-05789489d25a5ceac0403613ad789d78198be6ee.tar.bz2
openembedded-core-contrib-05789489d25a5ceac0403613ad789d78198be6ee.zip
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" Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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}"
MESON_CROSS_FILE = ""
MESON_CROSS_FILE_class-target = "--cross-file ${WORKDIR}/meson.cross"
+CCOMPILER ?= "gcc"
+CXXCOMPILER ?= "g++"
+CCOMPILER_toolchain-clang = "clang"
+CXXCOMPILER_toolchain-clang = "clang++"
+
def meson_array(var, d):
return "', '".join(d.getVar(var).split()).join(("'", "'"))
@@ -49,8 +54,8 @@ do_write_config() {
# This needs to be Py to split the args into single-element lists
cat >${WORKDIR}/meson.cross <<EOF
[binaries]
-c = '${HOST_PREFIX}gcc'
-cpp = '${HOST_PREFIX}g++'
+c = '${HOST_PREFIX}${CCOMPILER}'
+cpp = '${HOST_PREFIX}${CXXCOMPILER}'
ar = '${HOST_PREFIX}ar'
ld = '${HOST_PREFIX}ld'
strip = '${HOST_PREFIX}strip'