Building the tip without mercurial now allows for manually setting a version with the version option
This commit is contained in:
parent
0498174d35
commit
0a9e0b2420
12
meson.build
12
meson.build
@ -1,4 +1,4 @@
|
|||||||
project('wofi', 'c', version : run_command('hg', 'identify').stdout().strip(), default_options : ['buildtype=release', 'warning_level=2'])
|
project('wofi', 'c', default_options : ['buildtype=release', 'warning_level=2'])
|
||||||
cc = meson.get_compiler('c')
|
cc = meson.get_compiler('c')
|
||||||
|
|
||||||
inc = include_directories('inc')
|
inc = include_directories('inc')
|
||||||
@ -8,7 +8,15 @@ threads = dependency('threads')
|
|||||||
wayland = dependency('wayland-client')
|
wayland = dependency('wayland-client')
|
||||||
dl = cc.find_library('dl')
|
dl = cc.find_library('dl')
|
||||||
|
|
||||||
add_project_arguments('-D_GNU_SOURCE', '-DVERSION="' + meson.project_version() + '"', language : 'c')
|
hg = find_program('hg', native : true, required : false)
|
||||||
|
|
||||||
|
version = get_option('version')
|
||||||
|
|
||||||
|
if hg.found()
|
||||||
|
version = run_command(hg, 'identify').stdout().strip()
|
||||||
|
endif
|
||||||
|
|
||||||
|
add_project_arguments('-D_GNU_SOURCE', '-DVERSION="' + version + '"', language : 'c')
|
||||||
add_project_link_arguments('-rdynamic', language : 'c')
|
add_project_link_arguments('-rdynamic', language : 'c')
|
||||||
|
|
||||||
executable(meson.project_name(),
|
executable(meson.project_name(),
|
||||||
|
1
meson_options.txt
Normal file
1
meson_options.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
option('version', type : 'string', value : 'hg', description : 'The version to use if mercurial cannot be found')
|
Loading…
Reference in New Issue
Block a user