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.
52 lines
2.2 KiB
52 lines
2.2 KiB
7 years ago
|
project('pkgconfig-gen-dependencies', 'c', version: '1.0')
|
||
7 years ago
|
|
||
|
pkgg = import('pkgconfig')
|
||
|
|
||
|
# libmain internally use libinternal and expose libexpose in its API
|
||
|
exposed_lib = shared_library('libexposed', 'exposed.c')
|
||
|
internal_lib = shared_library('libinternal', 'internal.c')
|
||
7 years ago
|
main_lib = both_libraries('libmain', link_with : [exposed_lib, internal_lib])
|
||
6 years ago
|
custom_lib = shared_library('custom', 'custom.c')
|
||
7 years ago
|
|
||
7 years ago
|
pkgg.generate(exposed_lib)
|
||
7 years ago
|
|
||
|
# Declare a few different Dependency objects
|
||
7 years ago
|
pc_dep = dependency('libfoo', version : '>=1.0')
|
||
7 years ago
|
pc_dep_dup = dependency('libfoo', version : '>= 1.0')
|
||
7 years ago
|
notfound_dep = dependency('notfound', required : false)
|
||
|
threads_dep = dependency('threads')
|
||
6 years ago
|
custom_dep = declare_dependency(link_with : custom_lib, compile_args : ['-DCUSTOM'])
|
||
7 years ago
|
custom2_dep = declare_dependency(link_args : ['-lcustom2'], compile_args : ['-DCUSTOM2'])
|
||
|
|
||
|
# Generate a PC file:
|
||
7 years ago
|
# - Having libmain in libraries should pull implicitly libexposed and libinternal in Libs.private
|
||
7 years ago
|
# - Having libexposed in libraries should remove it from Libs.private
|
||
|
# - We generated a pc file for libexposed so it should be in Requires instead of Libs
|
||
|
# - Having threads_dep in libraries should add '-pthread' in both Libs and Cflags
|
||
|
# - Having custom_dep in libraries and libraries_private should only add it in Libs
|
||
|
# - Having custom2_dep in libraries_private should not add its Cflags
|
||
|
# - Having pc_dep in libraries_private should add it in Requires.private
|
||
7 years ago
|
# - pc_dep_dup is the same library and same version, should be ignored
|
||
7 years ago
|
# - notfound_dep is not required so it shouldn't appear in the pc file.
|
||
6 years ago
|
pkgg.generate(libraries : [main_lib, exposed_lib, threads_dep, threads_dep, custom_dep, custom_dep, '-pthread'],
|
||
|
libraries_private : [custom_dep, custom2_dep, custom2_dep, pc_dep, pc_dep_dup, notfound_dep],
|
||
7 years ago
|
version : '1.0',
|
||
|
name : 'dependency-test',
|
||
|
filebase : 'dependency-test',
|
||
|
description : 'A dependency test.'
|
||
|
)
|
||
7 years ago
|
|
||
|
pkgg.generate(
|
||
|
name : 'requires-test',
|
||
|
version : '1.0',
|
||
|
description : 'Dependency Requires field test.',
|
||
|
requires : [exposed_lib, pc_dep, 'libhello'],
|
||
|
)
|
||
|
|
||
|
pkgg.generate(
|
||
|
name : 'requires-private-test',
|
||
|
version : '1.0',
|
||
|
description : 'Dependency Requires.private field test.',
|
||
|
requires_private : [exposed_lib, pc_dep, 'libhello', notfound_dep],
|
||
|
)
|