-
Notifications
You must be signed in to change notification settings - Fork 1
/
meson.build
152 lines (125 loc) · 4.17 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
project('enventor', 'c',
version : '1.0.99',
meson_version : '>= 0.53',
default_options : [
'warning_level=2',
'buildtype=debugoptimized',
'c_std=c99'
]
)
v_array = meson.project_version().split('.')
v_maj = v_array[0]
v_min = v_array[1]
v_mic = v_array[2]
# install paths
dir_prefix = get_option('prefix')
dir_include = join_paths(dir_prefix, get_option('includedir'))
dir_pkginclude = join_paths(dir_include, meson.project_name())
dir_bin = join_paths(dir_prefix, get_option('bindir'))
dir_lib = join_paths(dir_prefix, get_option('libdir'))
dir_data = join_paths(dir_prefix, get_option('datadir'))
dir_pkgdata = join_paths(dir_data, meson.project_name())
dir_locale = join_paths(dir_prefix, get_option('localedir'))
# binaries
cc = meson.get_compiler('c')
enventor_cflags = []
enventor_cflags_try = [
'-Wshadow',
'-Wstrict-prototypes',
'-Werror=missing-prototypes',
'-Werror=pointer-arith',
'-Wno-missing-field-initializers']
foreach cf: enventor_cflags_try
if cc.has_argument(cf) == true
enventor_cflags += cf
endif
endforeach
add_global_arguments(enventor_cflags, language: 'c')
have_visibility_hidden = cc.has_argument('-fvisibility=hidden')
if have_visibility_hidden
add_global_arguments('-fvisibility=hidden', language: 'c')
endif
pkgconfig = import('pkgconfig')
windows = import('windows')
eet = find_program('eet', native: true)
eet_exe = [ eet ]
edje_cc = find_program('edje_cc', native: true)
edje_cc_exe = [ edje_cc ]
# libraries
config_dir = [include_directories('.')]
efl_req = '>= 1.18.0'
enventor_deps = [
dependency('eina', version : efl_req),
dependency('eo', version : efl_req),
dependency('efl', version : efl_req),
dependency('eet', version : efl_req),
dependency('ecore', version : efl_req),
dependency('ecore-file', version : efl_req),
dependency('evas', version : efl_req),
dependency('eio', version : efl_req),
dependency('efreet', version : efl_req),
dependency('edje', version : efl_req),
dependency('elementary', version : efl_req)
]
requirement_enventor_pc = ' eina ' + efl_req + ' eo ' + efl_req + ' efl ' + efl_req + ' eet ' + efl_req + ' ecore ' + efl_req + ' ecore-file ' + efl_req + ' evas ' + efl_req + ' eio ' + efl_req + ' efreet ' + efl_req + ' edje ' + efl_req + ' elementary ' + efl_req
enventor_cargs = [
'-D_POSIX_C_SOURCE=200809L',
'-D_XOPEN_SOURCE=500' ]
have_nls = false
if get_option('nls') == true
intl_dep = cc.find_library('intl', required: false)
if intl_dep.found() == true and cc.has_header('libintl.h') == true
enventor_deps += cc.find_library('intl', required: true)
enventor_cargs += '-DENABLE_NLS'
have_nls = true
endif
endif
# configuration
config_h = configuration_data()
config_h.set_quoted('PACKAGE_NAME', meson.project_name())
config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
config_h.set_quoted('PACKAGE_BIN_DIR', dir_bin)
config_h.set_quoted('PACKAGE_LIB_DIR', dir_lib)
config_h.set_quoted('PACKAGE_DATA_DIR', dir_pkgdata)
config_h.set_quoted('LOCALE_DIR', dir_locale)
config_h.set('EFL_BETA_API_SUPPORT', '1')
config_h.set('EFL_UI_FOCUS_OBJECT_PROTECTED', '1')
config_h.set('ENVENTOR_BETA_API_SUPPORT', '1')
subdir('src/lib')
subdir('src/bin')
subdir('data/autocomp')
subdir('data/color')
subdir('data/desktop')
subdir('data/help')
subdir('data/icon')
subdir('data/images')
subdir('data/reference')
subdir('data/sounds')
subdir('data/templates')
subdir('data/themes/default')
subdir('pc')
if have_nls == true
subdir('po')
endif
install_data(
sources : 'README',
install_dir : join_paths(dir_pkgdata, 'docs')
)
# Use config_h after all subdirs have set values
configure_file(output : 'config.h', configuration : config_h)
# output
summary({'OS': host_machine.system(),
'NLS': have_nls ? 'yes' : 'no'
}, section: 'Configuration Options Summary:')
summary({'prefix': dir_prefix,
'bindir': dir_bin,
'libdir': dir_lib,
'incdir': dir_include,
'pkgincdir': dir_pkginclude,
'datadir': dir_data,
'pkgdatadir': dir_pkgdata,
'localedir': dir_locale,
}, section: 'Directories:')
summary({'compilation': 'ninja',
'installation': 'ninja install',
}, section: 'Compilation')