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-17 17:24:36 +00:00
|
|
|
'-D_POSIX_C_SOURCE=200112L',
|
2019-02-17 12:19:28 +00:00
|
|
|
],
|
|
|
|
language: 'c',
|
|
|
|
)
|
|
|
|
|
2019-03-16 15:31:58 +00:00
|
|
|
git = find_program('git', required: false)
|
2019-02-17 12:19:28 +00:00
|
|
|
wayland_server = dependency('wayland-server')
|
2019-03-16 15:31:58 +00:00
|
|
|
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']).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
|
|
|
|
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'
|
|
|
|
add_project_arguments('-DUNUSED(x)=UNUSED_ ## x __attribute__((__unused__))', language: 'c')
|
|
|
|
else
|
|
|
|
add_project_arguments('-DUNUSED(x)=UNUSED_ ## x', language: 'c')
|
|
|
|
endif
|
|
|
|
|
2019-02-17 12:19:28 +00:00
|
|
|
subdir('kiwmi')
|