Bump package version to 0.4.0
[libjaylink.git] / meson.build
blobaa4340ea8267a49d2ed7745ee3226b5cc148f5fe
1 project(
2   'libjaylink', 'c',
3   version: '0.4.0',
4   license: ' GPL-2.0-or-later',
5   meson_version: '>= 0.53.0',
6   default_options: [
7     'c_std=gnu99',
8     'warning_level=3',
9     'werror=true',
10   ]
13 project_description = 'Library to access J-Link devices'
14 project_url = 'https://gitlab.zapb.de/libjaylink/libjaylink.git'
16 cc = meson.get_compiler('c')
17 build_system = build_machine.system()
19 option_usb = get_option('usb')
21 include_dirs = include_directories('libjaylink')
23 libusb = dependency(
24   'libusb-1.0',
25   version: '>=1.0.16',
26   required: option_usb,
29 ws2_32 = cc.find_library('ws2_32', required: build_system == 'windows')
31 have_usb = libusb.found()
33 if have_usb
34   add_project_arguments('-DHAVE_LIBUSB', language: 'c')
35 endif
37 version = meson.project_version()
38 version_array = version.split('.')
39 major_version = version_array[0].to_int()
40 minor_version = version_array[1].to_int()
41 version_micro = version_array[2].to_int()
43 package_version = {
44   'major': version_array[0],
45   'minor': version_array[1],
46   'micro': version_array[2],
49 git = find_program('git', required: false)
51 if git.found()
52   git_tag = run_command([git, 'describe', '--dirty'], check: false).stdout().strip()
54   if git_tag != ''
55     package_version_string = git_tag
56   else
57     package_version_string = version
58   endif
59 else
60   package_version_string = version
61 endif
63 # Libtool interface version of libjaylink. This is not the same as the package
64 # version. For information about the versioning system of libtool, see:
65 # http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning
67 library_version = {
68   'current': 2,
69   'revision': 1,
70   'age': 2,
73 library_version_string = '@0@.@1@.@2@'.format(
74   library_version['current'] - library_version['age'],
75   library_version['age'],
76   library_version['revision'])
78 subdir('libjaylink')
80 summary({
81     'Package version': package_version_string,
82     'Library version': library_version_string,
83   },
84   section: 'Project details'
87 summary({
88     'USB': have_usb,
89     'TCP': true
90   },
91   section: 'Enabled transports',
92   bool_yn: true