Skip to content

Commit

Permalink
Remove MSVC project files and use Meson as universal build system
Browse files Browse the repository at this point in the history
  • Loading branch information
HolyWu committed May 19, 2021
1 parent 8bf9aa2 commit d0cae93
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 96 deletions.
58 changes: 0 additions & 58 deletions VMAF/VMAF.vcxproj

This file was deleted.

22 changes: 0 additions & 22 deletions VMAF/VMAF.vcxproj.filters

This file was deleted.

45 changes: 29 additions & 16 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,30 +1,43 @@
project('VMAF', 'cpp',
default_options : ['buildtype=release', 'b_ndebug=if-release', 'cpp_std=c++17'],
meson_version : '>=0.48.0',
version : '6'
default_options: ['buildtype=release', 'warning_level=2', 'b_lto=true', 'b_ndebug=if-release', 'cpp_std=c++17'],
license: 'MIT',
meson_version: '>=0.51.0',
version: '6'
)

add_project_arguments('-ffast-math', language : 'cpp')
cxx = meson.get_compiler('cpp')

gcc_syntax = cxx.get_argument_syntax() == 'gcc'

if get_option('buildtype') == 'release'
add_project_arguments(gcc_syntax ? ['-fno-math-errno', '-fno-trapping-math'] : ['/GS-', '/fp:except-'], language: 'cpp')
endif

if gcc_syntax
vapoursynth_dep = dependency('vapoursynth').partial_dependency(compile_args: true, includes: true)
libvmaf_dep = dependency('libvmaf', version: '>=2.0.0')
deps = [vapoursynth_dep, libvmaf_dep]
install_dir = vapoursynth_dep.get_variable(pkgconfig: 'libdir') / 'vapoursynth'
else
libvmaf_dep = cxx.find_library('libvmaf')
thread_dep = cxx.find_library('pthreads')
deps = [libvmaf_dep, thread_dep]
install_dir = get_option('libdir') / 'vapoursynth'
endif

sources = [
'VMAF/VMAF.cpp'
]

vapoursynth_dep = dependency('vapoursynth').partial_dependency(compile_args : true, includes : true)

libvmaf_dep = dependency('libvmaf')

if host_machine.cpu_family().startswith('x86')
add_project_arguments('-mfpmath=sse', '-msse2', language : 'cpp')
if host_machine.cpu_family().startswith('x86') and gcc_syntax
add_project_arguments('-mfpmath=sse', '-msse2', language: 'cpp')
endif

vapoursynth_plugindir = join_paths(vapoursynth_dep.get_pkgconfig_variable('libdir'), 'vapoursynth')

shared_module('vmaf', sources,
dependencies : [vapoursynth_dep, libvmaf_dep],
install : true,
install_dir : vapoursynth_plugindir,
gnu_symbol_visibility : 'hidden'
dependencies: deps,
install: true,
install_dir: install_dir,
gnu_symbol_visibility: 'hidden'
)

install_subdir('VMAF/model',
Expand Down

0 comments on commit d0cae93

Please sign in to comment.