-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmeson.build
80 lines (60 loc) · 2.25 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
project('sample_webkit_web_extension', 'cpp',
version : '0.0.1',
license: 'MIT'
)
#########################
# Directories & Options #
########################
top_srcdir = meson.source_root()
includedir = include_directories('include')
webkit_port = get_option('webkit_port')
webkit_extension_path = get_option('extension_path')
###################
# End Directories #
###################
#########################
# External Dependencies #
#########################
glib_dep = dependency('glib-2.0', version: '>= 2.24.1')
if webkit_port == 'wpe'
webkit_port_dep = dependency('wpe-webkit-1.0', version: '>= 2.24.1')
webkit_port_web_extension_dep = dependency('wpe-web-extension-1.0', version: '>= 2.24.1')
elif webkit_port == 'gtk'
webkit_port_dep = dependency('webkit2gtk-4.0', version: '>= 2.24.1')
webkit_port_web_extension_dep = dependency('webkit2gtk-web-extension-4.0', version: '>= 2.24.1')
else
error('Invalid webkit_port option : ' + webkit_port)
endif
#############################
# End External Dependencies #
#############################
###############################
# Compiler and Linker options #
###############################
sample_extension_compiler_flag = ['-rdynamic', '-fvisibility=default']
sample_extension_compiler_flag += ['-Wall', '-Werror']
sample_extension_compiler_flag += ['-Wfloat-equal', '-Wformat=2', '-Wunreachable-code', '-Wundef', '-Winline', '-Wconversion', '-Wswitch', '-Wcast-align', '-Wshadow']
sample_extension_compiler_flag += ['-Wsign-conversion', '-Wint-to-pointer-cast', '-Wcast-function-type', '-Wno-parentheses']
##### Developer Compiler flags #####
sample_extension_compiler_flag += ['-g']
sample_extension_linker_flag = '-Wl,--as-needed'
##### Conditional CPP defines #####
if webkit_port == 'gtk'
sample_extension_compiler_flag += ['-DPLATFORM_GTK']
elif webkit_port == 'wpe'
sample_extension_compiler_flag += ['-DPLATFORM_WPE']
endif
add_project_arguments([sample_extension_compiler_flag, sample_extension_linker_flag], language : 'cpp')
###################################
# End compiler and Linker options #
###################################
#########
# Build #
#########
subdirs = [ 'src' ]
foreach n : subdirs
subdir(n)
endforeach
#############
# End Build #
#############