mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 21:53:41 +00:00
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:
parent
44f10698ed
commit
9e725226da
5 changed files with 11 additions and 18 deletions
|
@ -20,6 +20,10 @@ if get_option('loaders').contains('svg') == true
|
||||||
config_h.set10('THORVG_SVG_LOADER_SUPPORT', true)
|
config_h.set10('THORVG_SVG_LOADER_SUPPORT', true)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if get_option('loaders').contains('png') == true
|
||||||
|
config_h.set10('THORVG_PNG_LOADER_SUPPORT', true)
|
||||||
|
endif
|
||||||
|
|
||||||
if get_option('vectors').contains('avx') == true
|
if get_option('vectors').contains('avx') == true
|
||||||
config_h.set10('THORVG_AVX_VECTOR_SUPPORT', true)
|
config_h.set10('THORVG_AVX_VECTOR_SUPPORT', true)
|
||||||
endif
|
endif
|
||||||
|
@ -33,10 +37,6 @@ if get_option('log') == true
|
||||||
message('Enable Log')
|
message('Enable Log')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if get_option('png') == true
|
|
||||||
config_h.set10('THORVG_PNG_LOADER_SUPPORT', true)
|
|
||||||
endif
|
|
||||||
|
|
||||||
configure_file(
|
configure_file(
|
||||||
output: 'config.h',
|
output: 'config.h',
|
||||||
configuration: config_h
|
configuration: config_h
|
||||||
|
|
|
@ -6,9 +6,9 @@ option('engines',
|
||||||
|
|
||||||
option('loaders',
|
option('loaders',
|
||||||
type: 'array',
|
type: 'array',
|
||||||
choices: ['', 'svg'],
|
choices: ['', 'svg', 'png'],
|
||||||
value: ['svg'],
|
value: ['svg'],
|
||||||
description: 'Enable Vector File Loader in thorvg')
|
description: 'Enable File Loaders in thorvg')
|
||||||
|
|
||||||
option('vectors',
|
option('vectors',
|
||||||
type: 'array',
|
type: 'array',
|
||||||
|
@ -33,11 +33,6 @@ option('examples',
|
||||||
value: false,
|
value: false,
|
||||||
description: 'Enable building examples')
|
description: 'Enable building examples')
|
||||||
|
|
||||||
option('png',
|
|
||||||
type: 'boolean',
|
|
||||||
value: false,
|
|
||||||
description: 'Enable libpng based png loading')
|
|
||||||
|
|
||||||
option('test',
|
option('test',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
value: false,
|
value: false,
|
||||||
|
|
|
@ -5,8 +5,9 @@ if get_option('loaders').contains('svg') == true
|
||||||
message('Enable SVG Loader')
|
message('Enable SVG Loader')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if get_option('png') == true
|
if get_option('loaders').contains('png') == true
|
||||||
subdir('png')
|
subdir('png')
|
||||||
|
message('Enable PNG Loader')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
subdir('raw')
|
subdir('raw')
|
||||||
|
|
|
@ -3,7 +3,10 @@ source_file = [
|
||||||
'tvgPngLoader.cpp',
|
'tvgPngLoader.cpp',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
png_dep = meson.get_compiler('cpp').find_library('libpng')
|
||||||
|
|
||||||
subloader_dep += [declare_dependency(
|
subloader_dep += [declare_dependency(
|
||||||
include_directories : include_directories('.'),
|
include_directories : include_directories('.'),
|
||||||
|
dependencies : png_dep,
|
||||||
sources : source_file
|
sources : source_file
|
||||||
)]
|
)]
|
||||||
|
|
|
@ -19,12 +19,6 @@ subdir('bindings')
|
||||||
thread_dep = meson.get_compiler('cpp').find_library('pthread')
|
thread_dep = meson.get_compiler('cpp').find_library('pthread')
|
||||||
thorvg_lib_dep = [common_dep, loader_dep, binding_dep, thread_dep]
|
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_lib = library(
|
||||||
'thorvg',
|
'thorvg',
|
||||||
include_directories : headers,
|
include_directories : headers,
|
||||||
|
|
Loading…
Add table
Reference in a new issue