X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=meson.build;h=85d16122bee0af3abb797a65312e304f18b98fe9;hb=0fe69908838248c28624beb540257892db6bdcbd;hp=f0c2fa1245863d9b088e19b20720594682c772ea;hpb=cfc9fee931c70554353ce6c4acc3407baac08745;p=tinc diff --git a/meson.build b/meson.build index f0c2fa12..85d16122 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('tinc', 'c', - version: '1.18pre', + version: run_command([find_program('python3'), 'version.py', 'short'], check: true).stdout(), license: 'GPL-2.0-or-later', meson_version: '>=0.51', default_options: [ @@ -35,6 +35,13 @@ os_name = host_machine.system() cpu_family = host_machine.cpu_family() cc_name = cc.get_id() +python = find_program('python3') +if meson_version.version_compare('>=0.55') + python_path = python.full_path() +else + python_path = python.path() +endif + cc_defs = ['-D_GNU_SOURCE'] if os_name == 'sunos' cc_defs += '-D__EXTENSIONS__' @@ -131,12 +138,13 @@ if os_name == 'linux' and not opt_systemd.disabled() subdir('systemd') endif -prog_reformat = find_program('astyle', native: true, required: false) -if prog_reformat.found() - run_target('reformat', command: [ - prog_reformat, - '--options=@SOURCE_ROOT@/.astylerc', '--recursive', - '@SOURCE_ROOT@/*.c', '@SOURCE_ROOT@/*.h', - ]) -endif +run_target('reformat', command: [ + python, + '@SOURCE_ROOT@/lint.py', + '--fix', +]) +run_target('lint', command: [ + python, + '@SOURCE_ROOT@/lint.py', +])