Skip to content

meson: Use gas-preprocessor as generator, for targets that need it

Martin Storsjö requested to merge mstorsjo/dav1d:gaspp into master

Don't pass the .S assembly sources as C source files in this case, as e.g. MSVC doesn't support them (and meson knows it doesn't, so it refuses to proceed with an MSVC/gas-preprocessor wrapper script, as meson detects it as MSVC - unless meson is hacked to allow passing .S files to MSVC).

This allows building dav1d with MSVC for ARM targets without hacks to meson. (Building in a pure MSVC setup with no other compilers available does require a few new patches to gas-preprocessor though.)

This has been postponed for quite some time, as compiling with MSVC for non-x86 targets in meson has been problematic, as meson used to require a working compiler for the build system as well, and MSVC for all targets are named cl.exe, and you can't have one for the cross target and the build machine first in the path at the same time. This was recently fixed though, see https://github.com/mesonbuild/meson/issues/4402 and https://github.com/mesonbuild/meson/pull/6512.

This matches how gas-preprocessor is hooked up for e.g. OpenH264 in https://github.com/cisco/openh264/commit/013c4566a219a1f0fd50a8186f2b11fd8c3efcfb.

While this isn't as neat as just passing the .S files as C sources and dealing with it elsewhere, the "elsewhere" bit has been a bit of a mess - this avoids relying on non-upstreamable patches to meson and a bunch of extra wrapper scripts for gas-preprocessor.

Merge request reports