The Meson Build System
http://mesonbuild.com/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.4 KiB
55 lines
1.4 KiB
11 years ago
|
project('pkgconfig-gen', 'c')
|
||
|
|
||
7 years ago
|
# First check we have pkg-config >= 0.29
|
||
|
|
||
|
pkgconfig = find_program('pkg-config', required: false)
|
||
|
if not pkgconfig.found()
|
||
|
error('MESON_SKIP_TEST: pkg-config not found')
|
||
|
endif
|
||
|
|
||
|
v = run_command(pkgconfig, '--version').stdout().strip()
|
||
|
if v.version_compare('<0.29')
|
||
|
error('MESON_SKIP_TEST: pkg-config version \'' + v + '\' too old')
|
||
|
endif
|
||
|
|
||
9 years ago
|
pkgg = import('pkgconfig')
|
||
|
|
||
9 years ago
|
lib = shared_library('simple', 'simple.c')
|
||
11 years ago
|
libver = '1.0'
|
||
10 years ago
|
h = install_headers('simple.h')
|
||
11 years ago
|
|
||
9 years ago
|
pkgg.generate(
|
||
8 years ago
|
libraries : [lib, '-lz'],
|
||
9 years ago
|
subdirs : '.',
|
||
|
version : libver,
|
||
|
name : 'libsimple',
|
||
|
filebase : 'simple',
|
||
9 years ago
|
description : 'A simple demo library.',
|
||
|
requires : 'glib-2.0', # Not really, but only here to test that this works.
|
||
|
requires_private : ['gio-2.0', 'gobject-2.0'],
|
||
8 years ago
|
libraries_private : [lib, '-lz'],
|
||
|
)
|
||
|
|
||
7 years ago
|
test('pkgconfig-validation', pkgconfig,
|
||
|
args: ['--validate', 'simple'],
|
||
7 years ago
|
env: [ 'PKG_CONFIG_PATH=' + meson.current_build_dir() + '/meson-private' ])
|
||
8 years ago
|
|
||
|
# Test that name_prefix='' and name='libfoo' results in '-lfoo'
|
||
|
lib2 = shared_library('libfoo', 'simple.c',
|
||
|
name_prefix : '',
|
||
|
version : libver)
|
||
|
|
||
|
pkgg.generate(
|
||
|
libraries : lib2,
|
||
|
name : 'libfoo',
|
||
|
version : libver,
|
||
8 years ago
|
description : 'A foo library.',
|
||
|
variables : ['foo=bar', 'datadir=${prefix}/data']
|
||
|
)
|
||
7 years ago
|
|
||
|
pkgg.generate(
|
||
|
name : 'libhello',
|
||
|
description : 'A minimalistic pkgconfig file.',
|
||
|
version : libver,
|
||
|
)
|