sway/meson.build

48 lines
1.3 KiB
Meson
Raw Normal View History

2017-11-29 14:03:12 +00:00
project(
'sway',
'c',
license: 'MIT',
default_options: [
'c_std=c11',
'warning_level=2',
'werror=true',
],
)
cc = meson.get_compiler('c')
2017-11-30 08:41:51 +00:00
jsonc = dependency('json-c', version: '>=0.12.1')
pcre = dependency('libpcre')
wlroots = dependency('wlroots')
2017-11-29 14:03:12 +00:00
wayland_server = dependency('wayland-server')
wayland_client = dependency('wayland-client')
wayland_egl = dependency('wayland-egl')
wayland_protos = dependency('wayland-protocols')
xkbcommon = dependency('xkbcommon')
2017-11-30 08:41:51 +00:00
pango = dependency('pango')
pixman = dependency('pixman-1')
libcap = dependency('libcap')
2017-11-29 14:03:12 +00:00
math = cc.find_library('m')
2017-11-30 09:48:08 +00:00
git = find_program('git', required: false)
2017-11-29 14:03:12 +00:00
2017-11-30 09:48:08 +00:00
version = get_option('sway_version')
if version != ''
version = '"@0@"'.format(version)
else
if not git.found()
error('git is required to make the version string')
endif
git_commit_hash = run_command([git.path(), 'describe', '--always', '--tags']).stdout().strip()
git_branch = run_command([git.path(), 'rev-parse', '--abbrev-ref', 'HEAD']).stdout().strip()
version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(git_commit_hash, git_branch)
endif
2017-11-30 09:29:32 +00:00
add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c')
2017-11-29 14:03:12 +00:00
sway_inc = include_directories('include')
2017-11-30 08:39:27 +00:00
subdir('common')
subdir('sway')
2017-11-29 14:03:12 +00:00