kiwmi/meson.build

67 lines
1.8 KiB
Meson
Raw Permalink Normal View History

2019-02-17 12:19:28 +00:00
project(
'kiwmi',
'c',
license: 'MPL-2.0',
default_options: [
'c_std=c11',
'warning_level=2',
],
)
add_project_arguments(
[
'-DWLR_USE_UNSTABLE',
2019-03-19 19:33:39 +00:00
'-D_POSIX_C_SOURCE=200809L',
2019-02-17 12:19:28 +00:00
],
language: 'c',
)
2019-12-10 23:37:43 +00:00
git = find_program('git', required: false)
2020-05-11 15:11:23 +00:00
lua = dependency(get_option('lua-pkg'))
pixman = dependency('pixman-1')
2020-01-03 18:40:11 +00:00
wayland_client = dependency('wayland-client')
2019-12-10 23:37:43 +00:00
wayland_protocols = dependency('wayland-protocols')
wayland_scanner = dependency('wayland-scanner')
wayland_server = dependency('wayland-server')
wlroots = dependency('wlroots')
xkbcommon = dependency('xkbcommon')
2019-02-17 12:19:28 +00:00
include = include_directories('include')
version = get_option('kiwmi-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'], check: false)
git_branch = run_command([git.path(), 'rev-parse', '--abbrev-ref', 'HEAD'], check: false)
if git_commit_hash.returncode() != 0 or git_branch.returncode() != 0
error('need the git directory to make the version string')
endif
version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(
git_commit_hash.stdout().strip(),
git_branch.stdout().strip(),
)
2019-02-17 12:19:28 +00:00
endif
add_project_arguments('-DKIWMI_VERSION=@0@'.format(version), language: 'c')
2019-03-07 17:51:33 +00:00
compiler = meson.get_compiler('c')
if compiler.get_id() == 'gcc' or compiler.get_id() == 'clang'
2019-05-03 08:54:08 +00:00
add_project_arguments('-DUNUSED(x)=UNUSED_ ## x __attribute__((__unused__))', language: 'c')
2019-03-07 17:51:33 +00:00
else
2019-05-03 08:54:08 +00:00
add_project_arguments('-DUNUSED(x)=UNUSED_ ## x', language: 'c')
2019-03-07 17:51:33 +00:00
endif
2021-07-30 19:46:58 +00:00
install_data(
'kiwmi.desktop',
install_dir: join_paths(get_option('datadir'), 'wayland-sessions')
)
2019-12-10 23:37:43 +00:00
subdir('protocols')
2019-02-17 12:19:28 +00:00
subdir('kiwmi')
2020-01-03 18:40:11 +00:00
subdir('kiwmic')