-
Notifications
You must be signed in to change notification settings - Fork 108
/
Copy pathmeson.build
145 lines (108 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
common_taiseilib_args = [
'--rootdir', meson.project_source_root(),
]
common_taiseilib_defs = [
'-DMESON_BUILD_ROOT=@0@'.format(meson.project_build_root()),
'-DMESON_SOURCE_ROOT=@0@'.format(meson.project_source_root()),
]
preprocess_script = find_program(files('configure-file.py'))
preprocess_args = common_taiseilib_args + common_taiseilib_defs
preprocess_command = [preprocess_script, preprocess_args]
preprocessor = generator(preprocess_script,
arguments: preprocess_args + ['@EXTRA_ARGS@', '--depfile', '@DEPFILE@', '@INPUT@', '@OUTPUT@'],
output: '@BASENAME@',
depfile: '@[email protected]',
)
eolconv_script = find_program(files('eolconv.py'))
eolconv_command = [eolconv_script]
package_system_name = host_machine.system()
if package_system_name == 'darwin'
package_system_name = 'macOS' # could also be iOS etc., but we don't support that.
elif package_system_name == 'nx'
package_system_name = 'switch'
endif
host_eol_style = package_system_name == 'windows' ? 'crlf' : 'lf'
dist_version_string = taisei_version_string
if is_developer_build
dist_version_string = '@0@-devbuild'.format(dist_version_string)
endif
if is_debug_build
dist_version_string = '@0@-debug'.format(dist_version_string)
endif
dist_script = find_program(files('gen-dist.py'))
dist_name = 'Taisei-@0@-@1@-@2@'.format(dist_version_string, package_system_name, host_machine.cpu_family())
dist_command = [dist_script, common_taiseilib_args]
dist_prefix_args = ['--prefix=@0@'.format(dist_name)]
zip_filename = '@[email protected]'.format(dist_name)
zip_outpath = join_paths(meson.project_build_root(), zip_filename)
zip_command = [dist_command, '--format=zip', meson.project_build_root(), zip_outpath]
txz_filename = '@[email protected]'.format(dist_name)
txz_outpath = join_paths(meson.project_build_root(), txz_filename)
txz_command = [dist_command, '--format=xztar', dist_prefix_args, meson.project_build_root(), txz_outpath]
tgz_filename = '@[email protected]'.format(dist_name)
tgz_outpath = join_paths(meson.project_build_root(), tgz_filename)
tgz_command = [dist_command, '--format=gztar', dist_prefix_args, meson.project_build_root(), tgz_outpath]
tbz_filename = '@[email protected]'.format(dist_name)
tbz_outpath = join_paths(meson.project_build_root(), tbz_filename)
tbz_command = [dist_command, '--format=bztar', dist_prefix_args, meson.project_build_root(), tbz_outpath]
tar_filename = '@[email protected]'.format(dist_name)
tar_outpath = join_paths(meson.project_build_root(), tar_filename)
tar_command = [dist_command, '--format=tar', dist_prefix_args, meson.project_build_root(), tar_outpath]
dmg_script = find_program(files('macos-gen-dmg.py'))
dmg_filename = '@[email protected]'.format(dist_name)
dmg_command = [dmg_script, join_paths(meson.project_build_root(), dmg_filename), meson.project_build_root()]
angle_enabled = get_option('install_angle')
if package_system_name == 'windows'
nsis_script = find_program(files('win-gen-nsis.py'))
nsis_filename = 'Taisei-@0@-setup-@[email protected]'.format(dist_version_string, host_machine.cpu_family())
nsis_outpath = join_paths(meson.build_root(), nsis_filename)
nsis_defs = [
'-DOUTPUT=@0@'.format(nsis_outpath),
]
if host_machine.cpu_family() == 'x86_64'
nsis_defs += '-DTAISEI_64BIT=1'
else
nsis_defs += '-DTAISEI_64BIT=0'
endif
if angle_enabled
nsis_defs += '-DUSE_ANGLE=1'
else
nsis_defs += '-DUSE_ANGLE=0'
endif
nsis_command = [
nsis_script,
common_taiseilib_args,
common_taiseilib_defs,
nsis_defs,
meson.build_root(),
files('taisei.nsi.in')
]
endif
gen_atlas_script = find_program(files('gen-atlas.py'))
gen_atlas_command = [gen_atlas_script]
gen_atlases_script = find_program(files('gen-atlases.py'))
gen_atlases_command = [gen_atlases_script]
upkeep_script = find_program(files('upkeep.py'))
upkeep_command = [upkeep_script, common_taiseilib_args]
upkeep_target = run_target('upkeep', command: upkeep_command)
pack_script = find_program(files('pack.py'))
pack_command = [pack_script, common_taiseilib_args]
glob_script = find_program(files('glob-search.py'))
glob_command = [glob_script]
check_submodules_script = find_program(files('check-submodules.py'))
check_submodules_command = [check_submodules_script]
fix_path_script = find_program(files('unfuck-path.py'))
fix_path_command = [fix_path_script]
format_array_script = find_program(files('format-array.py'))
format_array_command = [format_array_script]
on_dist_script = find_program(files('on-meson-dist.py'))
meson.add_dist_script(on_dist_script)
index_resources_script = find_program(files('index-resources.py'))
index_resources_command = [index_resources_script, common_taiseilib_args]
res_index_install_script = find_program(files('res-index-install.py'))
res_index_install_command = [res_index_install_script, common_taiseilib_args]
macos_install_dylibs_script = find_program(files('macos-install-dylibs.py'))
# NOTE/FIXME: script doesn't use taiseilib
macos_install_dylibs_command = [macos_install_dylibs_script]
post_install_remove_script = find_program(files('post-install-remove.py'))
post_install_remove_command = [post_install_remove_script, common_taiseilib_args]