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.
23 lines
900 B
23 lines
900 B
8 years ago
|
project('shared module', 'c')
|
||
|
|
||
8 years ago
|
dl = meson.get_compiler('c').find_library('dl', required : false)
|
||
|
l = shared_library('runtime', 'runtime.c')
|
||
8 years ago
|
# Do NOT link the module with the runtime library. This
|
||
|
# is a common approach for plugins that are only used
|
||
|
# with dlopen. Any symbols are resolved dynamically
|
||
8 years ago
|
# at runtime. This requires extra help on Windows, so
|
||
7 years ago
|
# should be avoided unless really necessary.
|
||
8 years ago
|
m = shared_module('mymodule', 'module.c')
|
||
7 years ago
|
e = executable('prog', 'prog.c',
|
||
|
link_with : l, export_dynamic : true, dependencies : dl)
|
||
8 years ago
|
test('import test', e, args : m)
|
||
6 years ago
|
|
||
6 years ago
|
# Same as above, but module created with build_target()
|
||
|
m2 = build_target('mymodule2', 'module.c', target_type: 'shared_module')
|
||
|
test('import test 2', e, args : m2)
|
||
|
|
||
6 years ago
|
# Shared module that does not export any symbols
|
||
6 years ago
|
shared_module('nosyms', 'nosyms.c',
|
||
|
install : true,
|
||
|
install_dir : join_paths(get_option('libdir'), 'modules'))
|