aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/meson.bbclass
AgeCommit message (Collapse)Author
2018-03-06meson.bbclass: fix to build for more projectsChen Qi
We should use the value of CC for the c compiler setting in cross compilation configuration file for meson. For example, if we only use ${HOST_PREFIX}gcc instead of ${CC}, we would meet the following do_compile failure for systemd. cc1: fatal error: linux/capability.h: No such file or directory Do the same change for LD, AR, NM, STRIP and READELF. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-02-24meson.bbclass: Add support for nativesdkPeter Kjellerstedt
We need to use the meson.cross file when building for nativesdk. Additionally, we need to trick meson's sanity tests, just as it is done for target builds. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-01-29meson: Adjust for clang compilerKhem Raj
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>
2018-01-19meson.bbclass: add MESON_LINK_ARGS to vardepsMartin Kelly
Currently, we include MESON_C_ARGS in write_config[vardeps], but we don't include MESON_LINK_ARGS, which also affects meson.cross. In addition, we include TOOLCHAIN_OPTIONS, from which both are derived. Add MESON_LINK_ARGS, and remove TOOLCHAIN_OPTIONS, which does not directly appear in meson.cross and should be pulled in indirectly by MESON_C_ARGS and MESON_LINK_ARGS. Signed-off-by: Martin Kelly <mkelly@xevo.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-01-19meson.bbclass: include C{, XX}FLAGS in cross argsMartin Kelly
Currently, CFLAGS and CXXFLAGS are not making it into the compile line. This is because meson appends CFLAGS/CXXFLAGS from the environment only for native but not for cross builds (probably to keep cross-builds more isolated). As a result, we need to make sure these vars goes into meson.cross. This is similar to what cmake.bbclass does with OECMAKE_C_FLAGS and OECMAKE_CXX_FLAGS. Change c_args and cpp_args in meson.cross to include these vars, and update write_config[vardeps] accordingly. Signed-off-by: Martin Kelly <mkelly@xevo.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-01-19meson.bbclass: compile with --buildtype plainMartin Kelly
OE manages all the compile flags, so we don't want meson to inject its own flags. Currently, it's injecting -O0 and causing build breaks when security flags are enabled (because _FORTIFY_SOURCE requires an optimized build and meson defaults to a debug -O0 build). Add --buildtype plain so meson will not add its own optimization flags. Signed-off-by: Martin Kelly <mkelly@xevo.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-01-12meson.bbclass: use HOST_CC_ARCH, not TARGET_CC_ARCHChristopher Larson
Using TARGET_CC_ARCH is inconsistent with CC, which uses HOST_CC_ARCH, and the rest of meson.bbclass, which uses HOST_PREFIX, HOST_OS, etc. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-05meson: export native env only for native buildMartin Kelly
Although the meson crossfile should take care of setting the right cross environment for a target build, meson slurps any set CFLAGS, CXXFLAGS, LDFLAGS, and CPPFLAGS from the environment and injects them into the build (see mesonbuild/environment.py:get_args_from_envvars for details). This means that we are seeing native CFLAGS, CXXFLAGS, LDFLAGS, and CPPFLAGS in the target build, which is wrong and causes build failures when target and native have libraries in common (the linker gets confused and bails). That said, we *do* need to set certain vars for all builds so that meson can find the right build tools. Without this, meson will fail during its sanity checking step because it will determine the build tools to be unrunnable since they output target instead of native artifacts. The solution to all of this is to set CC, CXX, LD, and AR globally to the native tools while setting the other native vars *only* for the native build. For target builds, these vars will get overridden by the cross file as we expect. Signed-off-by: Martin Kelly <mkelly@xevo.com> Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-04meson: add a recipe and class from meta-oeAlexander Kanavin
The original recipe has been provided and improved by: Ross Burton <ross.burton@intel.com> Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Adam C. Foltzer <acfoltzer@galois.com> Peter Kjellerstedt <peter.kjellerstedt@axis.com> Linus Svensson <linussn@axis.com> I have added patches to fix up gtk-doc and gobject-introspection in cross-compilation environments, and also change the order of linker arguments to replicate autotools more closely (and fix linking errors in some corner cases). Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>