infra meson: Add -Dstatic option

Add an option for use in environments where
the use of static libraries must be enforced.
This commit is contained in:
JunsuChoi 2021-11-02 09:50:08 +09:00 committed by Hermet Park
parent abc3b40a37
commit 590381f68b
2 changed files with 17 additions and 4 deletions

View file

@ -47,3 +47,8 @@ option('log',
type: 'boolean',
value: false,
description: 'Enable log message')
option('static',
type: 'boolean',
value: false,
description: 'Enable to use static library(png, jpg)')

View file

@ -9,16 +9,24 @@ if all_loaders or get_option('loaders').contains('svg') == true
endif
if all_loaders or get_option('loaders').contains('png') == true
subdir('external_png')
if not png_dep.found()
if get_option('static') == true
subdir('png')
else
subdir('external_png')
if not png_dep.found()
subdir('png')
endif
endif
endif
if all_loaders or get_option('loaders').contains('jpg') == true
subdir('external_jpg')
if not jpg_dep.found()
if get_option('static') == true
subdir('jpg')
else
subdir('external_jpg')
if not jpg_dep.found()
subdir('jpg')
endif
endif
endif