-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
200 lines (138 loc) · 5.1 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# Hatchet project build file
#============================================================================
# init
#============================================================================
# init project
#---------------------------------------------------
project(
'hatchet',
['c', 'cpp'],
default_options : [
'cpp_std=c++11',
'warning_level=3',
# 'optimization=3',
'debug=true'
],
version : run_command(
'python', '-c',
'''with open('./VERSION','r') as f: print(f.read());''' ).stdout().strip(),
license : 'GPLv3'
)
sys_name = host_machine.system().to_lower()
# init compiler
#---------------------------------------------------
cpp = meson.get_compiler('cpp')
if sys_name.contains('darwin')
objcpp = meson.get_compiler('objcpp')
endif
add_project_arguments(get_option('cxxflags'), language : 'cpp')
add_project_link_arguments(get_option('ldflags'), language: 'cpp')
qt5 = import('qt5')
cmake = import('cmake')
pkg = import('pkgconfig')
sys_name = host_machine.system().to_lower()
# init configuration
#---------------------------------------------------
config_h = configuration_data()
config_h.set(
'HAVE_CXX17', 1,
description : 'Define if the compiler supports basic C++17 syntax')
package_name = meson.project_name()
config_h.set_quoted(
'PACKAGE_NAME', package_name,
description : 'Define to the full name of this package.'
)
package_tarname = meson.project_name()
config_h.set_quoted(
'PACKAGE_TARNAME', package_tarname,
description : 'Define to the one symbol short name of this package.')
package_version = meson.project_version()
config_h.set_quoted(
'PACKAGE_VERSION', package_version,
description : 'Define to the version of this package.')
package_string = '@0@ @1@'.format(package_name, package_version)
config_h.set_quoted(
'PACKAGE_STRING', package_string,
description : 'Define to the full name and version of this package.')
package_url = 'https://ever3st.com'
config_h.set_quoted(
'PACKAGE_URL', package_url,
description : 'Define to the home page for this package.')
package_bug_url = 'https://github.com/hatchet-player/Hatchet/issues'
config_h.set_quoted(
'PACKAGE_BUGREPORT', package_bug_url,
description : 'Define to the address where bug reports for this' +
'package should be sent.')
# Hatchet application info
#---------------------------------------------------
hatchet_organization_name = 'hatchet'
hatchet_organization_domain = 'hatchet-player.org'
hatchet_application_name = 'Hatchet'
hatchet_description_summary = 'Hatchet media player'
hatchet_application_package_name = 'org.hatchet-player.Hatchet'
# env
#============================================================================
# set install directories
#---------------------------------------------------
prefix = get_option('prefix')
libdir = join_paths(prefix, get_option('libdir'))
bindir = join_paths(prefix, get_option('bindir'))
datadir = join_paths(prefix, get_option('datadir'))
sysconfdir = join_paths(prefix, get_option('sysconfdir'))
libexecdir = join_paths(prefix, get_option('libexecdir'))
mandir = join_paths(prefix, get_option('mandir'))
includedir = join_paths(prefix, get_option('includedir'))
hatchet_inc = [include_directories('.', 'src')]
# set cmake directories
#---------------------------------------------------
config_h.set_quoted('CMAKE_INSTALL_PREFIX', prefix)
config_h.set_quoted('CMAKE_INSTALL_LIBDIR', libdir)
# checking headers
#============================================================================
# checking functions
#============================================================================
# checking data types
#============================================================================
# Look For Required Programs
#============================================================================
# Git is
# required for fetching subprojects & dependencies
#----------------------------------------------------
git = find_program('git', required : true)
# Python is required for custom generators
#----------------------------------------------------
python = find_program('python', required : true)
# OS Specific checks
#============================================================================
if (sys_name.contains('nt'))
hatchet_target_name = 'hatchet'
hatchet_system = 'Windows'
elif sys_name.contains('darwin')
hatchet_target_name = 'hatchet'
hatchet_system = 'OS X'
elif sys_name.contains('linux')
hatchet_target_name = 'hatchet'
hatchet_system = 'Linux'
else
hatchet_target_name = 'Uknown Platform'
hatchet_system = 'Please submit a ticket to resolve this issue'
endif
hatchet_base_target_name = hatchet_target_name.to_lower()
# build
#============================================================================
# build hatchet
#---------------------------------------------------
project_dirs = [
'dependencies',
'extra',
'src',
#'admin'
#'lang'
]
foreach dir : project_dirs
subdir(dir)
endforeach
# foreach x : libhatchet_gui_src
# a = run_command('echo', x).stdout().strip()
# message(a)
# endforeach