From 9a4d297a91c96602ef7141065c25a307aba29bc1 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 30 Oct 2021 14:27:53 +0300 Subject: [PATCH 3/3] Meson: Make single check for libsqlite3 Check existence of libsqlite3 just once and assign the result to a variable that is then used instead of separate checks in every place it's needed. See osdn #43045 Signed-off-by: Marko Lindqvist --- meson.build | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index f0d54ac7d8..6d63a4465c 100644 --- a/meson.build +++ b/meson.build @@ -346,6 +346,8 @@ else gettext_dep = [] endif +sqlite3_dep = c_compiler.find_library('libsqlite3', dirs: cross_lib_path) + if get_option('gitrev') priv_conf_data.set('GITREV', 1) endif @@ -607,7 +609,7 @@ common_lib = library('freeciv', c_compiler.find_library('m'), c_compiler.find_library('z', dirs: cross_lib_path), c_compiler.find_library('libcurl', dirs: cross_lib_path), - c_compiler.find_library('libsqlite3', dirs: cross_lib_path), + sqlite3_dep, ws2_dep, jansson_dep, lua_dep, lzma_dep, bcrypt_lib_dep, iconv_lib_dep, gettext_dep, dependency('threads')], @@ -2573,8 +2575,7 @@ executable('freeciv-mp-gtk3', c_args: [ '-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_20', '-DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_22'], include_directories: tool_inc, - dependencies: [gtk322_dep, - c_compiler.find_library('libsqlite3', dirs: cross_lib_path)], + dependencies: [gtk322_dep, sqlite3_dep], link_with: [common_lib, fcmp_common], install: true ) @@ -2593,8 +2594,7 @@ executable('freeciv-mp-gtk4', c_args: [ '-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_4_0', '-DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_4_0'], include_directories: tool_inc, - dependencies: [gtk4_dep, - c_compiler.find_library('libsqlite3', dirs: cross_lib_path)], + dependencies: [gtk4_dep, sqlite3_dep], link_with: [common_lib, fcmp_common], install: true ) @@ -2618,8 +2618,7 @@ executable('freeciv-mp-qt', 'tools/fcmp/mpgui_qt_worker.cpp', mocced_fcmp, include_directories: tool_inc, - dependencies: [qt5_dep, - c_compiler.find_library('libsqlite3', dirs: cross_lib_path)], + dependencies: [qt5_dep, sqlite3_dep], link_with: [common_lib, fcmp_common], install: true ) @@ -2631,7 +2630,7 @@ if get_option('fcmp').contains('cli') executable('freeciv-mp-cli', 'tools/fcmp/mpcli.c', include_directories: tool_inc, - dependencies: [c_compiler.find_library('libsqlite3', dirs: cross_lib_path)], + dependencies: [sqlite3_dep], link_with: [common_lib, fcmp_common], install: true ) -- 2.30.2