Here is cross-file example I use for cross compiling with meson build system. It is passed to meson with --cross-file
option.
[host_machine]
system = 'linux'
cpu_family = 'arm'
cpu = ''
endian = 'little'
[binaries]
c = 'arm-linux-gnueabihf-cc'
cpp = 'arm-linux-gnueabihf-g++'
ld = 'arm-linux-gnueabihf-ld'
ar = 'arm-linux-gnueabihf-ar'
strip = 'arm-linux-gnueabihf-strip'
pkgconfig = 'pkg-config'
[properties]
c_args = ['-march=armv7-a', '-mtune=cortex-a9', '-mlittle-endian', '-I/sysroot/usr/include']
cpp_args = ['-march=armv7-a', '-mtune=cortex-a9', '-mlittle-endian', '-I/sysroot/usr/include']
c_link_args = ['-march=armv7-a', '-mtune=cortex-a9', '-mlittle-endian', '-L/sysroot/lib', '-Wl,-rpath-link=/sysroot/staging/lib', '-L/sysroot/usr/lib', '-Wl,-rpath-link=/sysroot/usr/lib']
cpp_link_args = ['-march=armv7-a', '-mtune=cortex-a9', '-mlittle-endian', '-L/sysroot/lib', '-Wl,-rpath-link=/sysroot/staging/lib', '-L/sysroot/usr/lib', '-Wl,-rpath-link=/sysroot/usr/lib']
It worked fine. But after upgrading meson to the newest version, I get the following warnings:
DEPRECATION: c_args in the [properties] section of the machine file is deprecated, use the [built-in options] section.
DEPRECATION: cpp_args in the [properties] section of the machine file is deprecated, use the [built-in options] section.
DEPRECATION: c_link_args in the [properties] section of the machine file is deprecated, use the [built-in options] section.
DEPRECATION: cpp_link_args in the [properties] section of the machine file is deprecated, use the [built-in options] section.
How can I fix this?