Add initial meson file but it's incomplete

Compilation fails and x265 subproject is not ported yet
This commit is contained in:
King_DuckZ 2021-03-15 17:01:00 +01:00
parent f26408bcad
commit 426a6c6f3b
2 changed files with 142 additions and 0 deletions

113
meson.build Normal file
View file

@ -0,0 +1,113 @@
project('bpg', 'c',
version: '0.9.8',
meson_version: '>=0.49.2',
default_options: [
'buildtype=release',
'b_ndebug=if-release',
]
)
png_dep = dependency('libpng', required: true)
jpeg_dep = dependency('libjpeg', required: true)
sdl_dep = dependency('sdl', required: get_option('BPG_USE_BPGVIEW'), disabler: true)
sdl_image_dep = dependency('SDL_image', required: get_option('BPG_USE_BPGVIEW'), disabler: true)
public_incl = include_directories('.')
add_project_arguments(
'-D_FILE_OFFSET_BITS=64',
'-D_LARGEFILE_SOURCE',
'-D_REENTRANT',
'-DCONFIG_BPG_VERSION="' + meson.project_version() + '"',
'-Wall',
'-MMD',
'-fno-asynchronous-unwind-tables',
'-fdata-sections',
'-ffunction-sections',
'-fno-math-errno',
'-fno-signed-zeros',
'-fno-tree-vectorize',
'-fomit-frame-pointer',
language: 'c',
)
if get_option('BPG_USE_JCTVC_HIGH_BIT_DEPTH')
add_project_arguments('-DRExt__HIGH_BIT_DEPTH_SUPPORT', language: 'c')
endif
bpg_lib = library(meson.project_name(),
'libavcodec/hevc_cabac.c',
'libavcodec/hevc_filter.c',
'libavcodec/hevc.c',
'libavcodec/hevcpred.c',
'libavcodec/hevc_refs.c',
'libavcodec/hevcdsp.c',
'libavcodec/hevc_mvs.c',
'libavcodec/hevc_ps.c',
'libavcodec/hevc_sei.c',
'libavcodec/utils.c',
'libavcodec/cabac.c',
'libavcodec/golomb.c',
'libavcodec/videodsp.c',
'libavutil/mem.c',
'libavutil/buffer.c',
'libavutil/log2_tab.c',
'libavutil/frame.c',
'libavutil/pixdesc.c',
'libavutil/md5.c',
'libbpg.c',
install: true,
c_args: [
'-D_ISOC99_SOURCE',
'-D_POSIX_C_SOURCE=200112',
'-D_XOPEN_SOURCE=600',
'-DHAVE_AV_CONFIG_H',
'-D_GNU_SOURCE=1',
'-DUSE_VAR_BIT_DEPTH',
'-DUSE_PRED',
],
)
bpg_dep = declare_dependency(
link_with: bpg_lib,
include_directories: public_incl,
)
if not get_option('BPG_USE_BPGVIEW').disabled()
executable('bpgview',
'bpgview.c',
install: true,
dependencies: [
bpg_dep,
sdl_dep,
sdl_image_dep
]
)
endif
bpgenc_sources = ['bpgenc.c']
bpgenc_deps = [bpg_dep, png_dep, jpeg_dep]
bpgenc_args = []
if get_option('BPG_USE_X265')
bpgenc_sources += ['x265_glue.c']
subdir('x265/source')
bpgenc_deps += [x265_static_dep]
bpgenc_args += ['-DUSE_X265']
endif
executable('bpgdec',
'bpgdec.c',
install: true,
dependencies: [bpg_dep, png_dep],
)
executable('bpgenc',
bpgenc_sources,
install: true,
dependencies: bpgenc_deps,
c_args: bpgenc_args,
)

29
meson_options.txt Normal file
View file

@ -0,0 +1,29 @@
option('BPG_USE_EMCC',
type: 'boolean',
value: false,
description: 'Enable compilation of Javascript decoder with Emscripten'
)
option('BPG_USE_X265',
type: 'boolean',
value: true,
description: 'Enable x265 for the encoder'
)
option('BPG_USE_JCTVC',
type: 'boolean',
value: false,
description: 'Enable the JCTVC code (best quality but slow) for the encoder'
)
option('BPG_USE_BPGVIEW',
type: 'feature',
value: 'auto',
description: 'Compile bpgview (SDL and SDL_image libraries needed)'
)
option('BPG_USE_JCTVC_HIGH_BIT_DEPTH',
type: 'boolean',
value: false,
description: 'Enable it to use bit depths > 12 (need more tests to validate encoder)'
)