2019-07-11 20:10:59 +02:00
|
|
|
project('foot', 'c',
|
2019-06-12 20:08:54 +02:00
|
|
|
version: '0.9.0',
|
|
|
|
|
license: 'MIT',
|
|
|
|
|
default_options: [
|
|
|
|
|
'c_std=c11',
|
|
|
|
|
'warning_level=1',
|
|
|
|
|
'werror=true',
|
|
|
|
|
'b_ndebug=if-release'])
|
|
|
|
|
|
|
|
|
|
is_debug_build = get_option('buildtype').startswith('debug')
|
|
|
|
|
|
2019-08-11 16:03:29 +02:00
|
|
|
version = '"@0@"'.format(meson.project_version())
|
|
|
|
|
|
|
|
|
|
sh = find_program('sh', native: true)
|
|
|
|
|
git = find_program('git', required: false, native: true)
|
|
|
|
|
|
|
|
|
|
if git.found()
|
|
|
|
|
commit_hash = run_command(
|
|
|
|
|
[sh.path(), '-c',
|
|
|
|
|
'@0@ --git-dir="$MESON_SOURCE_ROOT/.git" describe --always --tags'.format(
|
|
|
|
|
git.path())])
|
|
|
|
|
|
|
|
|
|
branch = run_command(
|
|
|
|
|
[sh.path(), '-c',
|
|
|
|
|
'@0@ --git-dir="$MESON_SOURCE_ROOT/.git" rev-parse --abbrev-ref HEAD'.format(
|
|
|
|
|
git.path())])
|
|
|
|
|
|
|
|
|
|
if commit_hash.returncode() == 0 and branch.returncode() == 0
|
|
|
|
|
version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(
|
|
|
|
|
commit_hash.stdout().strip(), branch.stdout().strip())
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
|
2019-06-12 20:08:54 +02:00
|
|
|
add_project_arguments(
|
2019-07-29 20:10:55 +02:00
|
|
|
['-D_GNU_SOURCE=200809L',
|
2019-08-11 16:03:29 +02:00
|
|
|
'-DFOOT_VERSION=@0@'.format(version)] +
|
2019-06-12 20:08:54 +02:00
|
|
|
(is_debug_build ? ['-D_DEBUG'] : []),
|
|
|
|
|
language: 'c',
|
|
|
|
|
)
|
2019-06-13 16:24:35 +02:00
|
|
|
|
|
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
|
math = cc.find_library('m')
|
|
|
|
|
|
2019-06-19 10:04:47 +02:00
|
|
|
threads = dependency('threads')
|
2019-08-15 21:21:22 +02:00
|
|
|
freetype = dependency('freetype2')
|
2019-06-12 20:08:54 +02:00
|
|
|
fontconfig = dependency('fontconfig')
|
2019-08-15 21:21:22 +02:00
|
|
|
pixman = dependency('pixman-1')
|
2019-06-12 20:08:54 +02:00
|
|
|
wayland_protocols = dependency('wayland-protocols')
|
|
|
|
|
wayland_client = dependency('wayland-client')
|
|
|
|
|
wayland_cursor = dependency('wayland-cursor')
|
|
|
|
|
xkb = dependency('xkbcommon')
|
|
|
|
|
|
|
|
|
|
wayland_protocols_datadir = wayland_protocols.get_pkgconfig_variable('pkgdatadir')
|
|
|
|
|
|
|
|
|
|
wscanner = dependency('wayland-scanner', native: true)
|
|
|
|
|
wscanner_prog = find_program(
|
|
|
|
|
wscanner.get_pkgconfig_variable('wayland_scanner'), native: true)
|
|
|
|
|
|
|
|
|
|
wl_proto_headers = []
|
|
|
|
|
wl_proto_src = []
|
|
|
|
|
foreach prot : [
|
|
|
|
|
wayland_protocols_datadir + '/stable/xdg-shell/xdg-shell.xml',
|
2019-08-30 17:55:45 +02:00
|
|
|
wayland_protocols_datadir + '/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml',
|
2019-08-12 21:22:38 +02:00
|
|
|
wayland_protocols_datadir + '/unstable/xdg-output/xdg-output-unstable-v1.xml',
|
2019-07-11 17:02:21 +02:00
|
|
|
wayland_protocols_datadir + '/unstable/primary-selection/primary-selection-unstable-v1.xml',
|
2019-06-12 20:08:54 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
wl_proto_headers += custom_target(
|
|
|
|
|
prot.underscorify() + '-client-header',
|
|
|
|
|
output: '@BASENAME@.h',
|
|
|
|
|
input: prot,
|
|
|
|
|
command: [wscanner_prog, 'client-header', '@INPUT@', '@OUTPUT@'])
|
|
|
|
|
|
|
|
|
|
wl_proto_src += custom_target(
|
|
|
|
|
prot.underscorify() + '-private-code',
|
|
|
|
|
output: '@BASENAME@.c',
|
|
|
|
|
input: prot,
|
|
|
|
|
command: [wscanner_prog, 'private-code', '@INPUT@', '@OUTPUT@'])
|
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
|
|
executable(
|
2019-07-11 20:10:59 +02:00
|
|
|
'foot',
|
2019-07-19 11:11:25 +02:00
|
|
|
'base64.c', 'base64.h',
|
2019-07-16 11:52:22 +02:00
|
|
|
'config.c', 'config.h',
|
2019-07-09 16:26:36 +02:00
|
|
|
'commands.c', 'commands.h',
|
2019-06-15 22:22:44 +02:00
|
|
|
'csi.c', 'csi.h',
|
2019-06-13 16:24:35 +02:00
|
|
|
'font.c', 'font.h',
|
2019-06-17 19:33:10 +02:00
|
|
|
'grid.c', 'grid.h',
|
2019-06-19 10:04:47 +02:00
|
|
|
'input.c', 'input.h',
|
2019-06-12 20:08:54 +02:00
|
|
|
'log.c', 'log.h',
|
|
|
|
|
'main.c',
|
2019-06-15 22:22:44 +02:00
|
|
|
'osc.c', 'osc.h',
|
2019-07-05 10:16:56 +02:00
|
|
|
'render.c', 'render.h',
|
2019-08-27 17:23:28 +02:00
|
|
|
'search.c', 'search.h',
|
2019-07-11 09:51:51 +02:00
|
|
|
'selection.c', 'selection.h',
|
2019-06-12 20:08:54 +02:00
|
|
|
'shm.c', 'shm.h',
|
2019-06-13 15:19:10 +02:00
|
|
|
'slave.c', 'slave.h',
|
2019-06-29 21:03:28 +02:00
|
|
|
'terminal.c', 'terminal.h',
|
2019-07-17 09:46:45 +02:00
|
|
|
'tokenize.c', 'tokenize.h',
|
2019-06-12 20:08:54 +02:00
|
|
|
'tllist.h',
|
2019-06-15 22:22:44 +02:00
|
|
|
'vt.c', 'vt.h',
|
2019-06-12 20:08:54 +02:00
|
|
|
wl_proto_src + wl_proto_headers,
|
2019-08-16 22:11:22 +02:00
|
|
|
dependencies: [threads, math, freetype, fontconfig, pixman, wayland_client, wayland_cursor, xkb],
|
2019-06-12 20:08:54 +02:00
|
|
|
install: true)
|
2019-07-15 15:47:45 +02:00
|
|
|
|
2019-07-18 14:00:33 +02:00
|
|
|
custom_target(
|
|
|
|
|
'terminfo',
|
|
|
|
|
output: 'f',
|
|
|
|
|
input: 'foot.info',
|
2019-07-21 20:46:17 +02:00
|
|
|
command: ['tic', '-x', '-o', '@OUTDIR@', '-e', 'foot,foot-direct', '@INPUT@'],
|
2019-07-18 14:00:33 +02:00
|
|
|
install: true,
|
|
|
|
|
install_dir: join_paths(get_option('datadir'), 'terminfo'))
|
|
|
|
|
|
2019-07-15 15:47:45 +02:00
|
|
|
install_data('foot.desktop', install_dir: join_paths(get_option('datadir'), 'applications'))
|
2019-09-20 18:06:54 +02:00
|
|
|
install_data('footrc', install_dir: join_paths(get_option('datadir'), 'foot'))
|
2019-08-11 20:54:28 +02:00
|
|
|
|
|
|
|
|
subdir('doc')
|