aboutsummaryrefslogtreecommitdiff
path: root/subprojects/packagefiles
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-01-18 23:35:14 +0100
committerPřemysl Eric Janouch <p@janouch.name>2022-01-19 01:11:47 +0100
commit45238d78cd9535b33bfbeeaaac4645af1bd93834 (patch)
tree13f9e3d1d69dbc563e9c77dd44f22d117a5614d7 /subprojects/packagefiles
parent8a656121a392c16428a05e27d6a33a7923e1b0b2 (diff)
downloadfiv-45238d78cd9535b33bfbeeaaac4645af1bd93834.tar.gz
fiv-45238d78cd9535b33bfbeeaaac4645af1bd93834.tar.xz
fiv-45238d78cd9535b33bfbeeaaac4645af1bd93834.zip
Mesonize JPEG Quant Smooth
Now SIMD works on amd64, although the build remains questionable, because it assumes that all of its compiler flags will work. This way we lose an uncomfortable git submodule. Also, add Meson subprojects to .gitignore.
Diffstat (limited to 'subprojects/packagefiles')
-rw-r--r--subprojects/packagefiles/libjpegqs/meson.build41
1 files changed, 41 insertions, 0 deletions
diff --git a/subprojects/packagefiles/libjpegqs/meson.build b/subprojects/packagefiles/libjpegqs/meson.build
new file mode 100644
index 0000000..9755f59
--- /dev/null
+++ b/subprojects/packagefiles/libjpegqs/meson.build
@@ -0,0 +1,41 @@
+# vim: noet ts=4 sts=4 sw=4:
+project('jpeg-qs', 'c')
+add_project_arguments(meson.get_compiler('c')
+ .get_supported_arguments('-Wno-misleading-indentation'),
+ '-DWITH_LOG', language : 'c')
+
+deps = [
+ dependency('libjpeg'),
+ meson.get_compiler('c').find_library('m', required : false),
+]
+
+if host_machine.cpu_family() == 'x86_64'
+ jpegqs_avx512 = static_library('jpegqs-avx512', 'libjpegqs.c',
+ c_args : ['-DSIMD_SELECT', '-DSIMD_NAME=avx512',
+ '-mavx512f', '-mfma', '-DSIMD_AVX512'],
+ dependencies : deps)
+ jpegqs_avx2 = static_library('jpegqs-avx2', 'libjpegqs.c',
+ c_args : ['-DSIMD_SELECT', '-DSIMD_NAME=avx2',
+ '-mavx2', '-mfma', '-DSIMD_AVX2'],
+ dependencies : deps)
+ jpegqs_sse2 = static_library('jpegqs-sse2', 'libjpegqs.c',
+ c_args : ['-DSIMD_SELECT', '-DSIMD_NAME=sse2', '-msse2', '-DSIMD_SSE2'],
+ dependencies : deps)
+ jpegqs_base = static_library('jpegqs-base', 'libjpegqs.c',
+ c_args : ['-DSIMD_SELECT', '-DSIMD_NAME=base', '-DSIMD_BASE'],
+ dependencies : deps)
+
+ jpegqs_lib = static_library('jpegqs', 'libjpegqs.c',
+ c_args : ['-DSIMD_SELECT'],
+ dependencies : deps,
+ link_with : [jpegqs_base, jpegqs_sse2, jpegqs_avx2, jpegqs_avx512])
+else
+ jpegqs_lib = static_library('jpegqs', 'libjpegqs.c',
+ c_args : ['-DNO_SIMD'],
+ dependencies : deps)
+endif
+
+jpegqs_dep = declare_dependency(
+ link_with : jpegqs_lib,
+ include_directories : include_directories('.'),
+)