meson: revise png loader meson script.

We hate spagettie code, not even build script.
this revise it to keep the build script consistency.
This commit is contained in:
Hermet Park 2021-04-02 12:49:18 +09:00 committed by GitHub
parent 44f10698ed
commit 9e725226da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 18 deletions

View file

@ -20,6 +20,10 @@ if get_option('loaders').contains('svg') == true
config_h.set10('THORVG_SVG_LOADER_SUPPORT', true)
endif
if get_option('loaders').contains('png') == true
config_h.set10('THORVG_PNG_LOADER_SUPPORT', true)
endif
if get_option('vectors').contains('avx') == true
config_h.set10('THORVG_AVX_VECTOR_SUPPORT', true)
endif
@ -33,10 +37,6 @@ if get_option('log') == true
message('Enable Log')
endif
if get_option('png') == true
config_h.set10('THORVG_PNG_LOADER_SUPPORT', true)
endif
configure_file(
output: 'config.h',
configuration: config_h

View file

@ -6,9 +6,9 @@ option('engines',
option('loaders',
type: 'array',
choices: ['', 'svg'],
choices: ['', 'svg', 'png'],
value: ['svg'],
description: 'Enable Vector File Loader in thorvg')
description: 'Enable File Loaders in thorvg')
option('vectors',
type: 'array',
@ -33,11 +33,6 @@ option('examples',
value: false,
description: 'Enable building examples')
option('png',
type: 'boolean',
value: false,
description: 'Enable libpng based png loading')
option('test',
type: 'boolean',
value: false,

View file

@ -5,8 +5,9 @@ if get_option('loaders').contains('svg') == true
message('Enable SVG Loader')
endif
if get_option('png') == true
if get_option('loaders').contains('png') == true
subdir('png')
message('Enable PNG Loader')
endif
subdir('raw')

View file

@ -3,7 +3,10 @@ source_file = [
'tvgPngLoader.cpp',
]
png_dep = meson.get_compiler('cpp').find_library('libpng')
subloader_dep += [declare_dependency(
include_directories : include_directories('.'),
dependencies : png_dep,
sources : source_file
)]

View file

@ -19,12 +19,6 @@ subdir('bindings')
thread_dep = meson.get_compiler('cpp').find_library('pthread')
thorvg_lib_dep = [common_dep, loader_dep, binding_dep, thread_dep]
if get_option('png') == true
message('Enable libpng based png loading')
png_dep = meson.get_compiler('cpp').find_library('libpng')
thorvg_lib_dep += png_dep
endif
thorvg_lib = library(
'thorvg',
include_directories : headers,