Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/videolan/dav1d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2020-09-18 00:24:39 +0300
committerMartin Storsjö <martin@martin.st>2020-09-20 16:13:18 +0300
commitd68a2fc18131191cf41a33ce8585df86f5c40dea (patch)
treedb09347fc9da38d776b1ae3e4e8b92e2482d2455 /meson.build
parentd85fdf524dc88e0d9b3bb2bf4d45089c46d3abf0 (diff)
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 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.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build22
1 files changed, 22 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index af233ad..86fb652 100644
--- a/meson.build
+++ b/meson.build
@@ -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: '@BASENAME@.obj',
+ 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)