From 24bf2fc96a0a89a773538568884e07b18f9c4907 Mon Sep 17 00:00:00 2001 From: Holy Wu Date: Thu, 29 Nov 2018 23:13:49 +0800 Subject: [PATCH] Add Meson build system --- README.md | 7 +++++++ configure.ac | 2 +- meson.build | 43 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 meson.build diff --git a/README.md b/README.md index f889b7e..752303f 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,13 @@ Usage Compilation =========== +``` +meson build +ninja -C build +``` + +or + ``` ./autogen.sh ./configure diff --git a/configure.ac b/configure.ac index f656559..8a0db6c 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ X86="false" AS_CASE( [$host_cpu], [i?86], [BITS="32" X86="true"], - [x86_64], [BITS="64" X86="true"], + [x86_64], [BITS="64" X86="true"] ) AS_CASE( diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..3029fde --- /dev/null +++ b/meson.build @@ -0,0 +1,43 @@ +project('DeblockPP7', 'cpp', + default_options : ['buildtype=release', 'b_ndebug=if-release', 'cpp_std=c++14'], + meson_version : '>=0.48.0', + version : '4' +) + +sources = [ + 'DeblockPP7/DeblockPP7.cpp', + 'DeblockPP7/DeblockPP7.hpp', + 'DeblockPP7/vectorclass/instrset.h', + 'DeblockPP7/vectorclass/instrset_detect.cpp' +] + +libs = [] + +vapoursynth_dep = dependency('vapoursynth').partial_dependency(compile_args : true, includes : true) + +add_project_arguments('-ffast-math', language : 'cpp') + +if host_machine.cpu_family().startswith('x86') + sources += [ + 'DeblockPP7/DeblockPP7_SSE2.cpp', + 'DeblockPP7/vectorclass/vectorclass.h', + 'DeblockPP7/vectorclass/vectorf128.h', + 'DeblockPP7/vectorclass/vectori128.h' + ] + + add_project_arguments('-DVS_TARGET_CPU_X86', '-mfpmath=sse', '-msse2', language : 'cpp') + + libs += static_library('sse4', 'DeblockPP7/DeblockPP7_SSE4.cpp', + dependencies : vapoursynth_dep, + cpp_args : '-msse4.1', + gnu_symbol_visibility : 'hidden' + ) +endif + +shared_module('deblockpp7', sources, + dependencies : vapoursynth_dep, + link_with : libs, + install : true, + install_dir : join_paths(vapoursynth_dep.get_pkgconfig_variable('libdir'), 'vapoursynth'), + gnu_symbol_visibility : 'hidden' +)