forked from nyorain/rvg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
95 lines (81 loc) · 1.96 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
project('rvg', ['cpp', 'c'],
license: 'MIT',
version: '0.1.0',
meson_version: '>=0.43',
default_options: [
'cpp_std=c++1z',
'c_std=c99',
'warning_level=3',
'werror=true'])
build_example_ny = get_option('example-ny')
build_example_glfw = get_option('example-glfw')
build_tests = get_option('tests')
warnings = [
'-Wall',
'-Wextra',
'-Wpedantic',
# extra
'-Wduplicated-cond',
'-Wrestrict',
'-Wnull-dereference',
'-Wundef',
'-Wcast-align=strict',
'-Wlogical-op',
# TODO: currently only for ny
'-Wno-non-virtual-dtor',
'-Wno-unused-function',
]
# default arrguments
# warnings and stuff
cc = meson.get_compiler('cpp')
add_project_arguments(
cc.get_supported_arguments(warnings),
language: 'cpp')
# project-specific stuff
source_root = meson.source_root().split('\\')
add_project_arguments('-DDLG_BASE_PATH="' + '/'.join(source_root) + '/"', language: 'cpp')
dep_vpp = dependency('vpp',
version: '>=0.3.0',
fallback: ['vpp', 'vpp_dep'])
dep_nytl = dependency('nytl',
version: '>=0.6.0',
fallback: ['nytl', 'nytl_dep'])
dep_dlg = dependency('dlg',
version: '>=0.2.2',
fallback: ['dlg', 'dlg_dep'])
dep_katachi = dependency('katachi',
version: '>=0.1.0',
fallback: ['katachi', 'katachi_dep'])
dep_vulkan = dependency('vulkan')
src_inc = include_directories('src') # for shaders, internal headers
rvg_inc = include_directories('include')
rvg_deps = [
dep_vpp,
dep_nytl,
dep_dlg,
dep_katachi,
dep_vulkan
]
subdir('src/shaders')
subdir('src/rvg')
rvg_dep = declare_dependency(
link_with: rvg_lib,
dependencies: rvg_deps,
include_directories: rvg_inc)
if build_example_ny or build_example_glfw
subdir('example')
endif
if build_tests
subdir('docs/tests')
endif
# pkgconfig
pkg = import('pkgconfig')
pkg_dirs = ['.']
pkg.generate(
name: 'rvg',
requires: ['vulkan', 'katachi', 'vpp', 'nytl', 'dlg'],
libraries: rvg_lib,
filebase: 'rvg',
subdirs: pkg_dirs,
version: meson.project_version(),
description: 'Retained vulkan/vector graphics')