From 2b0bb4bae0d711f36e5c314f9761de43e7109673 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Tue, 2 Nov 2021 09:50:08 +0900 Subject: [PATCH] infra meson: Add -Dstatic option Add an option for use in environments where the use of static libraries must be enforced. --- meson_options.txt | 5 +++++ src/loaders/meson.build | 16 ++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index 8d95b2b..76de986 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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)') diff --git a/src/loaders/meson.build b/src/loaders/meson.build index d30f757..a62a91c 100644 --- a/src/loaders/meson.build +++ b/src/loaders/meson.build @@ -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 -- 2.7.4