Skip to content

Commit d2525f9

Browse files
committed
meson: Place additional flags in generated .pc file
Arrange to place -DWPE_ENABLE_XKB=1 when needed in the wpe-1.0.pc file generated by Meson, to mimic what the CMake build system does after #94 was merged.
1 parent 99343ea commit d2525f9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

meson.build

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ if default_backend != ''
4444
endif
4545

4646
dependencies = []
47+
pkg_cflags = []
4748

4849
#
4950
# Meson 0.55.0 is needed for "patch_directory" in .wrap files
@@ -52,7 +53,7 @@ dependencies = []
5253
can_allow_fallback = meson.version().version_compare('>=0.55.0')
5354

5455
if get_option('enable-xkb')
55-
add_project_arguments('-DWPE_ENABLE_XKB=1', language: ['c', 'cpp'])
56+
pkg_cflags += ['-DWPE_ENABLE_XKB=1']
5657
if can_allow_fallback
5758
dependencies += dependency('xkbcommon',
5859
fallback: ['libxkbcommon', 'libxkbcommon_dep'],
@@ -85,6 +86,10 @@ if not cc.has_function('dlopen')
8586
dependencies += dl_dep
8687
endif
8788

89+
if pkg_cflags.length() > 0
90+
add_project_arguments(pkg_cflags, language: ['c', 'cpp'])
91+
endif
92+
8893
libwpe = library('wpe-' + api_version,
8994
'src/input-xkb.c',
9095
'src/key-unicode.c',
@@ -111,6 +116,7 @@ import('pkgconfig').generate(
111116
subdirs: 'wpe-' + api_version,
112117
libraries: libwpe,
113118
version: meson.project_version(),
119+
extra_cflags: pkg_cflags,
114120
)
115121

116122
if get_option('build-docs')

0 commit comments

Comments
 (0)