meson.build (1685B)
1 project( 2 'kiwmi', 3 'c', 4 license: 'MPL-2.0', 5 default_options: [ 6 'c_std=c11', 7 'warning_level=2', 8 ], 9 ) 10 11 add_project_arguments( 12 [ 13 '-DWLR_USE_UNSTABLE', 14 '-D_POSIX_C_SOURCE=200809L', 15 ], 16 language: 'c', 17 ) 18 19 git = find_program('git', required: false) 20 lua = dependency(get_option('lua-pkg')) 21 pixman = dependency('pixman-1') 22 wayland_client = dependency('wayland-client') 23 wayland_protocols = dependency('wayland-protocols') 24 wayland_scanner = dependency('wayland-scanner') 25 wayland_server = dependency('wayland-server') 26 wlroots = dependency('wlroots') 27 xkbcommon = dependency('xkbcommon') 28 29 include = include_directories('include') 30 31 version = get_option('kiwmi-version') 32 if version != '' 33 version = '"@0@"'.format(version) 34 else 35 if not git.found() 36 error('git is required to make the version string') 37 endif 38 39 git_commit_hash = run_command([git.path(), 'describe', '--always', '--tags']).stdout().strip() 40 git_branch = run_command([git.path(), 'rev-parse', '--abbrev-ref', 'HEAD']).stdout().strip() 41 version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(git_commit_hash, git_branch) 42 endif 43 add_project_arguments('-DKIWMI_VERSION=@0@'.format(version), language: 'c') 44 45 compiler = meson.get_compiler('c') 46 if compiler.get_id() == 'gcc' or compiler.get_id() == 'clang' 47 add_project_arguments('-DUNUSED(x)=UNUSED_ ## x __attribute__((__unused__))', language: 'c') 48 else 49 add_project_arguments('-DUNUSED(x)=UNUSED_ ## x', language: 'c') 50 endif 51 52 install_data( 53 'kiwmi.desktop', 54 install_dir: join_paths(get_option('datadir'), 'wayland-sessions') 55 ) 56 57 subdir('protocols') 58 subdir('kiwmi') 59 subdir('kiwmic')