build: Use pkg-config to find iso-codes

Instead of hard-coding the path of iso-codes, we can get the prefix with
pkg-config. We still fallback to /usr when it is not available.

https://bugzilla.gnome.org/show_bug.cgi?id=792282
This commit is contained in:
Ting-Wei Lan 2018-01-07 03:39:22 +08:00
parent 3771c95c72
commit 14b181ebd4
4 changed files with 9 additions and 2 deletions

View File

@ -293,3 +293,5 @@
#mesondefine HAVE_HARFBUZZ
#mesondefine HAVE_PANGOFT
#mesondefine ISO_CODES_PREFIX

View File

@ -17,7 +17,6 @@
#include "language-names.h"
#define ISO_CODES_PREFIX "/usr"
#define ISO_CODES_DATADIR ISO_CODES_PREFIX "/share/xml/iso-codes"
#define ISO_CODES_LOCALESDIR ISO_CODES_PREFIX "/share/locale"

View File

@ -17,7 +17,6 @@
#include "language-names.h"
#define ISO_CODES_PREFIX "/usr"
#define ISO_CODES_DATADIR ISO_CODES_PREFIX "/share/xml/iso-codes"
#define ISO_CODES_LOCALESDIR ISO_CODES_PREFIX "/share/locale"

View File

@ -336,6 +336,7 @@ harfbuzz_dep = dependency('harfbuzz', version: '>= 0.9', required: false)
xkbdep = dependency('xkbcommon', version: xkbcommon_req, required: wayland_enabled)
graphene_dep = dependency('graphene-gobject-1.0', version: graphene_req,
fallback: ['graphene', 'graphene_dep'])
iso_codes_dep = dependency('iso-codes', required: false)
fontconfig_dep = [] # only used in x11 backend
atkbridge_dep = [] # only used in x11 backend
@ -349,6 +350,12 @@ endif
cdata.set('HAVE_HARFBUZZ', harfbuzz_dep.found())
cdata.set('HAVE_PANGOFT', pangoft_dep.found())
if iso_codes_dep.found()
cdata.set_quoted('ISO_CODES_PREFIX', iso_codes_dep.get_pkgconfig_variable('prefix'))
else
cdata.set_quoted('ISO_CODES_PREFIX', '/usr')
endif
backend_immodules = []
pc_gdk_extra_libs = []