-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeson.build
More file actions
79 lines (62 loc) · 1.54 KB
/
Copy pathmeson.build
File metadata and controls
79 lines (62 loc) · 1.54 KB
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
project('glad','c',
version: '2.0.6',
default_options: [
'default_library=static',
],
license: 'MIT'
)
# add options for glad module
opt_api = get_option('api')
arg_list = ['--api=' + opt_api]
opt_ext = get_option('extensions')
if opt_ext.length() > 0
arg_list += '--extensions=' + ','.join(opt_ext)
endif
if get_option('ext_option') != ''
arg_list += get_option('ext_option')
endif
arg_list += ['--out-path', 'glad.build', 'c']
# add options for each language generator
if get_option('alias')
arg_list += '--alias'
endif
if get_option('debug')
arg_list += '--debug'
endif
if get_option('header_only')
arg_list += '--header-only'
endif
if get_option('loader')
arg_list += '--loader'
endif
if get_option('mx')
arg_list += '--mx'
endif
if get_option('on_demand')
arg_list += ' --on-demand'
endif
if get_option('ext_c_option') != ''
arg_list += get_option('ext_c_option')
endif
# message(arg_str)
if host_machine.system() == 'windows'
generate_script = 'generate.bat'
else
generate_script = 'generate.sh'
endif
res = run_command(generate_script, arg_list, check: false)
if res.returncode() != 0
error('failed to generate glad sources.')
endif
lib = []
if not get_option('header_only')
lib = static_library(
'glad-lib',
'glad.build/src/gl.c',
include_directories: include_directories('glad.build/include'),
)
endif
glad_dep = declare_dependency(
include_directories: include_directories('glad.build/include'),
link_with: lib,
)