2019-11-17 09:04:21 +03:00
|
|
|
project(
|
|
|
|
'swappy',
|
|
|
|
'c',
|
2021-09-06 17:36:15 +03:00
|
|
|
version: '1.4.0',
|
2019-11-17 09:04:21 +03:00
|
|
|
license: 'MIT',
|
|
|
|
meson_version: '>=0.48.0',
|
|
|
|
default_options: [
|
|
|
|
'c_std=c11',
|
|
|
|
'warning_level=2',
|
|
|
|
'werror=true',
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2020-06-23 05:35:42 +03:00
|
|
|
version = '"@0@"'.format(meson.project_version())
|
|
|
|
git = find_program('git', native: true, required: false)
|
|
|
|
if git.found()
|
|
|
|
git_commit = run_command([git, 'rev-parse', '--short', 'HEAD'])
|
|
|
|
git_branch = run_command([git, 'rev-parse', '--abbrev-ref', 'HEAD'])
|
|
|
|
if git_commit.returncode() == 0 and git_branch.returncode() == 0
|
|
|
|
version = '"@0@-@1@ (" __DATE__ ", branch \'@2@\')"'.format(
|
|
|
|
meson.project_version(),
|
|
|
|
git_commit.stdout().strip(),
|
|
|
|
git_branch.stdout().strip(),
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
add_project_arguments('-DSWAPPY_VERSION=@0@'.format(version), language: 'c')
|
|
|
|
|
2019-11-17 09:04:21 +03:00
|
|
|
add_project_arguments('-Wno-unused-parameter', language: 'c')
|
|
|
|
|
|
|
|
swappy_inc = include_directories('include')
|
|
|
|
|
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
|
2019-12-28 03:55:34 +03:00
|
|
|
if cc.get_id() == 'clang'
|
|
|
|
message('clang')
|
|
|
|
add_global_arguments('-Wno-missing-field-initializers', language: 'c')
|
|
|
|
endif
|
|
|
|
|
2019-11-17 09:04:21 +03:00
|
|
|
cairo = dependency('cairo')
|
2020-01-02 00:37:08 +03:00
|
|
|
pango = dependency('pango')
|
2019-12-21 22:43:17 +03:00
|
|
|
math = cc.find_library('m')
|
2019-12-29 06:21:59 +03:00
|
|
|
gtk = dependency('gtk+-3.0', version: '>=3.20.0')
|
2020-06-25 04:39:09 +03:00
|
|
|
gio = dependency('gio-2.0')
|
2019-11-17 09:04:21 +03:00
|
|
|
|
2019-12-16 08:39:24 +03:00
|
|
|
subdir('res')
|
2020-06-22 04:58:35 +03:00
|
|
|
subdir('src/po')
|
2019-11-17 09:04:21 +03:00
|
|
|
|
|
|
|
executable(
|
|
|
|
'swappy',
|
2019-12-29 01:02:50 +03:00
|
|
|
swappy_resources,
|
2019-11-17 09:04:21 +03:00
|
|
|
files([
|
2019-11-24 21:25:34 +03:00
|
|
|
'src/main.c',
|
2020-06-07 06:56:16 +03:00
|
|
|
'src/algebra.c',
|
2019-12-29 10:19:42 +03:00
|
|
|
'src/application.c',
|
2019-12-02 07:29:48 +03:00
|
|
|
'src/box.c',
|
2019-11-24 21:25:34 +03:00
|
|
|
'src/config.c',
|
2019-12-16 03:51:11 +03:00
|
|
|
'src/clipboard.c',
|
2019-12-29 09:47:52 +03:00
|
|
|
'src/file.c',
|
2019-12-24 02:19:20 +03:00
|
|
|
'src/paint.c',
|
2020-01-20 01:26:04 +03:00
|
|
|
'src/pixbuf.c',
|
2019-12-24 01:35:47 +03:00
|
|
|
'src/render.c',
|
2020-01-02 00:37:08 +03:00
|
|
|
'src/util.c',
|
2019-11-17 09:04:21 +03:00
|
|
|
]),
|
|
|
|
dependencies: [
|
|
|
|
cairo,
|
2020-01-02 00:37:08 +03:00
|
|
|
pango,
|
2020-05-17 19:52:01 +03:00
|
|
|
gio,
|
2019-11-18 05:06:54 +03:00
|
|
|
gtk,
|
2019-12-21 22:43:17 +03:00
|
|
|
math,
|
2019-11-17 09:04:21 +03:00
|
|
|
],
|
2019-12-17 06:30:22 +03:00
|
|
|
link_args: '-rdynamic',
|
2019-11-17 09:04:21 +03:00
|
|
|
include_directories: [swappy_inc],
|
|
|
|
install: true,
|
|
|
|
)
|
|
|
|
|
|
|
|
scdoc = find_program('scdoc', required: get_option('man-pages'))
|
|
|
|
|
|
|
|
if scdoc.found()
|
|
|
|
sh = find_program('sh')
|
|
|
|
|
|
|
|
man_pages = ['swappy.1.scd']
|
|
|
|
|
|
|
|
mandir = get_option('mandir')
|
|
|
|
|
|
|
|
foreach src : man_pages
|
|
|
|
topic = src.split('.')[0]
|
|
|
|
section = src.split('.')[1]
|
|
|
|
output = '@0@.@1@'.format(topic, section)
|
|
|
|
|
|
|
|
custom_target(
|
|
|
|
output,
|
|
|
|
input: src,
|
|
|
|
output: output,
|
|
|
|
command: [
|
|
|
|
sh, '-c', '@0@ < @INPUT@ > @1@'.format(scdoc.path(), output)
|
|
|
|
],
|
|
|
|
install: true,
|
|
|
|
install_dir: '@0@/man@1@'.format(mandir, section)
|
|
|
|
)
|
|
|
|
endforeach
|
|
|
|
endif
|