meson.eclass: Write *FLAGS into meson cross build file
authorRaul E Rangel <rrangel@chromium.org>
Mon, 23 Apr 2018 15:53:07 +0000 (09:53 -0600)
committerMike Gilbert <floppym@gentoo.org>
Sat, 5 May 2018 19:56:43 +0000 (15:56 -0400)
commite6770aa6e9cd2d8fe3b833ad1844c3f3c80438af
treee8d2160ae3dd972477aec787571f234d3a1de0bd
parentaa89b1449bc88fc12783fea969cf5fe761d3498c
meson.eclass: Write *FLAGS into meson cross build file

Use python's shlex to parse the flags and generate an array that is
usable by meson. This will pass the flags correctly when doing a cross
build.

Example cross file output:

[properties]
c_args = ['-O2', '-pipe', '-march=armv8-a+crc', '-mtune=cortex-a57.cortex-a53', '-mfpu=crypto-neon-fp-armv8', '-mfloat-abi=hard', '-g', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables', '-clang-syntax']
c_link_args = ['-Wl,-O1', '-Wl,-O2', '-Wl,--as-needed']
cpp_args = ['-O2', '-O2', '-pipe', '-march=armv8-a+crc', '-mtune=cortex-a57.cortex-a53', '-mfpu=crypto-neon-fp-armv8', '-mfloat-abi=hard', '-g', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables', '-clang-syntax']
cpp_link_args = ['-Wl,-O1', '-Wl,-O2', '-Wl,--as-needed']
fortran_args = ['-O2']
objc_args = []
objcpp_args = []

See https://bugs.gentoo.org/653900 for upstream patch.

BUG=b:78351764
TEST=emerge-grunt and emerge-bob and verified the flags are passed to
mosys
BRANCH=none

Change-Id: Ic3d852232ec718141b87bc0729318699f0fad4f8
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Closes: https://bugs.gentoo.org/653900
eclass/meson.eclass