Skip to content

Commit 78ce9cb

Browse files
committed
3ds: update build definitions
1 parent cc00815 commit 78ce9cb

File tree

2 files changed

+33
-33
lines changed

2 files changed

+33
-33
lines changed

src/executables/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if build_application
2929
]
3030
subdir('platforms/switch')
3131
elif meson.is_cross_build() and host_machine.system() == '3ds'
32-
_3ds_options = [
32+
nintendo_options = [
3333
app_name,
3434
main_files,
3535
[liboopetris_graphics_dep, graphic_application_deps],

src/executables/platforms/3ds/meson.build

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
## get the options object and "unpack" it
22

3-
_3ds_exe_name = _3ds_options[0]
4-
_3ds_src_files = _3ds_options[1]
5-
_3ds_deps = _3ds_options[2]
3+
exe_name = nintendo_options[0]
4+
src_files = nintendo_options[1]
5+
deps = nintendo_options[2]
66

77
# libraries
88

9-
_3ds_dependencies = [
9+
dependencies = [
1010
'flac',
1111
'freetype2',
1212
'ogg',
@@ -17,7 +17,7 @@ _3ds_dependencies = [
1717
'zlib',
1818
]
1919

20-
_3ds_dependencies_native = [
20+
dependencies_native = [
2121
'bz2',
2222
'ctru',
2323
'mad',
@@ -27,13 +27,13 @@ _3ds_dependencies_native = [
2727
'SDL2main',
2828
]
2929

30-
_3ds_library_dirs = meson.get_external_property('library_dirs', [''])
31-
if _3ds_library_dirs.length() == 0
30+
library_dirs = meson.get_external_property('library_dirs', [''])
31+
if library_dirs.length() == 0
3232
error('property \'library_dirs\' has to be set!')
3333
endif
3434

35-
foreach dep : _3ds_dependencies
36-
_3ds_deps += dependency(
35+
foreach dep : dependencies
36+
deps += dependency(
3737
dep,
3838
required: true,
3939
allow_fallback: false,
@@ -42,20 +42,20 @@ foreach dep : _3ds_dependencies
4242
endforeach
4343

4444
c = meson.get_compiler('c')
45-
foreach dep : _3ds_dependencies_native
46-
_3ds_deps += c.find_library(
45+
foreach dep : dependencies_native
46+
deps += c.find_library(
4747
dep,
4848
required: true,
49-
dirs: _3ds_library_dirs,
49+
dirs: library_dirs,
5050
)
5151
endforeach
5252

5353
## compilation
5454

55-
_3ds_elf_file = build_target(
56-
_3ds_exe_name + '.elf',
57-
_3ds_src_files,
58-
dependencies: _3ds_deps,
55+
elf_file = build_target(
56+
exe_name + '.elf',
57+
src_files,
58+
dependencies: deps,
5959
override_options: {
6060
'warning_level': '3',
6161
'werror': true,
@@ -70,8 +70,8 @@ use_smdh = ['true', 'True', '1', true].contains(
7070

7171
_3dsxtool = find_program('3dsxtool')
7272

73-
_3DSX_FLAGS = [_3dsxtool, _3ds_elf_file.full_path(), _3ds_exe_name + '.3dsx']
74-
_3DSX_DEPS = [_3ds_elf_file]
73+
_3DSX_FLAGS = [_3dsxtool, elf_file.full_path(), exe_name + '.3dsx']
74+
_3DSX_DEPS = [elf_file]
7575
SMDH_DEPS = _3DSX_DEPS
7676

7777
fs = import('fs')
@@ -81,8 +81,7 @@ if use_smdh
8181
smdhtool = find_program('smdhtool')
8282
SMDH_FLAGS = [
8383
smdhtool,
84-
'--create',
85-
oopetris_name,
84+
'--create', oopetris_name,
8685
oopetris_desc,
8786
oopetris_author,
8887
]
@@ -92,9 +91,9 @@ if use_smdh
9291
error('property \'libctru\' has to be set!')
9392
endif
9493

95-
_3ds_default_icon = LIBCTRU / 'default_icon.png'
94+
default_icon = LIBCTRU / 'default_icon.png'
9695

97-
APP_ICON = meson.get_external_property('APP_ICON', _3ds_default_icon)
96+
APP_ICON = meson.get_external_property('APP_ICON', default_icon)
9897

9998
if not fs.is_absolute(APP_ICON)
10099
APP_ICON = meson.project_source_root() / APP_ICON
@@ -106,7 +105,7 @@ if use_smdh
106105

107106
SMDH_FLAGS += APP_ICON
108107

109-
SMDH_FLAGS += (_3ds_exe_name + '.smdh')
108+
SMDH_FLAGS += (exe_name + '.smdh')
110109

111110
APP_SMALL_ICON = meson.get_external_property('APP_SMALL_ICON', '')
112111

@@ -117,22 +116,23 @@ if use_smdh
117116

118117
if not fs.exists(APP_SMALL_ICON)
119118
error(
120-
'APP_SMALL_ICON should exist, but doesn\'t: \'' + APP_SMALL_ICON +
121-
'\'',
119+
'APP_SMALL_ICON should exist, but doesn\'t: \''
120+
+ APP_SMALL_ICON
121+
+ '\'',
122122
)
123123
endif
124124

125125
SMDH_FLAGS += APP_SMALL_ICON
126126
endif
127127

128-
# smdhtool --create <name> <long description> <author> <icon.png> <_3ds_exe_name>.smdh [<smallicon.png>]
128+
# smdhtool --create <name> <long description> <author> <icon.png> <exe_name>.smdh [<smallicon.png>]
129129
smdh_file = custom_target(
130-
_3ds_exe_name + '.smdh',
130+
exe_name + '.smdh',
131131
command: SMDH_FLAGS,
132-
output: [_3ds_exe_name + '.smdh'],
132+
output: [exe_name + '.smdh'],
133133
depends: SMDH_DEPS,
134134
)
135-
_3DSX_FLAGS += '--smdh=' + _3ds_exe_name + '.smdh'
135+
_3DSX_FLAGS += '--smdh=' + exe_name + '.smdh'
136136
_3DSX_DEPS += smdh_file
137137

138138
endif
@@ -153,11 +153,11 @@ if APP_ROMFS != ''
153153

154154
endif
155155

156-
# 3dsxtool <_3ds_exe_name>.elf <_3ds_exe_name>.3dsx <_3DSX_FLAGS>
156+
# 3dsxtool <exe_name>.elf <exe_name>.3dsx <_3DSX_FLAGS>
157157
custom_target(
158-
_3ds_exe_name + '.3dsx',
158+
exe_name + '.3dsx',
159159
command: _3DSX_FLAGS,
160160
depends: _3DSX_DEPS,
161-
output: [_3ds_exe_name + '.3dsx'],
161+
output: [exe_name + '.3dsx'],
162162
build_by_default: true,
163163
)

0 commit comments

Comments
 (0)