Skip to content

Commit

Permalink
Replace Autotools with Meson build system
Browse files Browse the repository at this point in the history
  • Loading branch information
HolyWu committed Dec 2, 2018
1 parent fa33034 commit 88c9623
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 122 deletions.
41 changes: 0 additions & 41 deletions Makefile.am

This file was deleted.

11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,17 @@ Usage

* device: Sets target OpenCL device. Use `list_device` to get the index of the available devices. By default the default device is selected.

* list_device: Whether the devices list is drawn on the frame.
* list_device: Whether to draw the devices list on the frame.

* info: Whether the OpenCL-related info is drawn on the frame.
* info: Whether to draw the OpenCL-related info on the frame.


Compilation
===========

Requires `Boost` unless configured with `--disable-opencl`.
Requires `Boost` unless specify `-D opencl=false`.

```
./autogen.sh
./configure
make
meson build
ninja -C build
```
3 changes: 0 additions & 3 deletions autogen.sh

This file was deleted.

72 changes: 0 additions & 72 deletions configure.ac

This file was deleted.

74 changes: 74 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
project('TCanny', 'cpp',
default_options : ['buildtype=release', 'b_ndebug=if-release', 'cpp_std=c++14'],
meson_version : '>=0.48.0',
version : '11'
)

add_project_arguments('-ffast-math', language : 'cpp')

sources = [
'TCanny/TCanny.cpp',
'TCanny/TCanny.hpp',
'TCanny/vectorclass/instrset.h',
'TCanny/vectorclass/instrset_detect.cpp'
]

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

deps = [vapoursynth_dep]

libs = []

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

sources += [
'TCanny/TCanny_SSE2.cpp',
'TCanny/vectorclass/vectorclass.h',
'TCanny/vectorclass/vectorf128.h',
'TCanny/vectorclass/vectorf256.h',
'TCanny/vectorclass/vectorf256e.h',
'TCanny/vectorclass/vectori128.h',
'TCanny/vectorclass/vectori256.h',
'TCanny/vectorclass/vectori256e.h',
'TCanny/vectorclass/vectormath_common.h',
'TCanny/vectorclass/vectormath_trig.h'
]

if get_option('opencl')
add_project_arguments('-DHAVE_OPENCL', language : 'cpp')

sources += [
'TCanny/TCannyCL.cpp'
]

opencl_dep = dependency('OpenCL', required : false)
if not opencl_dep.found()
opencl_dep = meson.get_compiler('cpp').find_library('OpenCL')
endif

boost_dep = dependency('boost', modules : ['filesystem', 'system'])

deps += [opencl_dep, boost_dep]
endif

libs += static_library('avx', 'TCanny/TCanny_AVX.cpp',
dependencies : [vapoursynth_dep],
cpp_args : ['-mavx'],
gnu_symbol_visibility : 'hidden'
)

libs += static_library('avx2', 'TCanny/TCanny_AVX2.cpp',
dependencies : [vapoursynth_dep],
cpp_args : ['-mavx2', '-mfma'],
gnu_symbol_visibility : 'hidden'
)
endif

shared_module('tcanny', sources,
dependencies : deps,
link_with : libs,
install : true,
install_dir : join_paths(vapoursynth_dep.get_pkgconfig_variable('libdir'), 'vapoursynth'),
gnu_symbol_visibility : 'hidden'
)
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
option('opencl', type : 'boolean', value : true, description : 'Enable TCannyCL filter')

0 comments on commit 88c9623

Please sign in to comment.