-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
meson: Use gas-preprocessor as generator, for targets that need it
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 mesonbuild/meson#4402 and mesonbuild/meson#6512. This matches how gas-preprocessor is hooked up for e.g. OpenH264 in cisco/openh264@013c456.
- Loading branch information
Showing
3 changed files
with
49 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -437,6 +437,28 @@ if is_asm_enabled and host_machine.cpu_family().startswith('x86') | |
]) | ||
endif | ||
|
||
use_gaspp = false | ||
if (is_asm_enabled and | ||
(host_machine.cpu_family() == 'aarch64' or | ||
host_machine.cpu_family().startswith('arm')) and | ||
cc.get_argument_syntax() == 'msvc') | ||
gaspp = find_program('gas-preprocessor.pl') | ||
use_gaspp = true | ||
gaspp_gen = generator(gaspp, | ||
output: '@[email protected]', | ||
arguments: [ | ||
'-as-type', 'armasm', | ||
'-arch', host_machine.cpu_family(), | ||
'--', | ||
host_machine.cpu_family() == 'aarch64' ? 'armasm64' : 'armasm', | ||
'-nologo', | ||
'-I@0@'.format(dav1d_src_root), | ||
'-I@0@/'.format(meson.current_build_dir()), | ||
'@INPUT@', | ||
'-c', | ||
'-o', '@OUTPUT@' | ||
]) | ||
endif | ||
|
||
# Generate config.h | ||
config_h_target = configure_file(output: 'config.h', configuration: cdata) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters