Add Meson build system
[libjaylink.git] / libjaylink / meson.build
blob2cbc42b23f40d1dcd9e4b1274cb5ff72e3d88649
1 sources = [
2   'buffer.c',
3   'c2.c',
4   'core.c',
5   'device.c',
6   'discovery.c',
7   'discovery_tcp.c',
8   'emucom.c',
9   'error.c',
10   'fileio.c',
11   'jtag.c',
12   'list.c',
13   'log.c',
14   'socket.c',
15   'spi.c',
16   'strutil.c',
17   'swd.c',
18   'swo.c',
19   'target.c',
20   'transport.c',
21   'transport_tcp.c',
22   'util.c',
23   'version.c',
26 if have_usb
27   sources += ['discovery_usb.c', 'transport_usb.c']
28 endif
30 version_h = configure_file(
31   input: 'version.h.in',
32   output: 'version.h',
33   configuration: {
34     'JAYLINK_VERSION_PACKAGE_MAJOR': package_version['major'],
35     'JAYLINK_VERSION_PACKAGE_MINOR': package_version['minor'],
36     'JAYLINK_VERSION_PACKAGE_MICRO': package_version['micro'],
37     'JAYLINK_VERSION_PACKAGE': package_version_string,
38     'JAYLINK_VERSION_LIBRARY_CURRENT': library_version['current'],
39     'JAYLINK_VERSION_LIBRARY_REVISION': library_version['revision'],
40     'JAYLINK_VERSION_LIBRARY_AGE': library_version['age'],
41     'JAYLINK_VERSION_LIBRARY': library_version_string,
42   }
45 install_headers([
46     version_h,
47     'libjaylink.h',
48   ],
49   subdir: 'libjaylink'
52 jaylink = shared_library(
53   'jaylink',
54   sources,
55   dependencies: [libusb],
56   version: library_version_string,
57   include_directories: include_dirs,
58   install: true,
61 pkg = import('pkgconfig')
63 pkg.generate(
64   jaylink,
65   name: meson.project_name(),
66   url: project_url,
67   description: project_description,
68   requires_private: [libusb],