Skip to content

Commit 16dc972

Browse files
committed
switch:
- update build definitions - use APP_ICON for switch
1 parent 78ce9cb commit 16dc972

File tree

3 files changed

+30
-29
lines changed

3 files changed

+30
-29
lines changed

platforms/build-switch.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ libnx='$LIBNX'
104104
USE_NACP = true
105105
106106
APP_ROMFS='$ROMFS'
107+
APP_ICON = './assets/icon/1024x1024.png'
107108
108109
EOF
109110

src/executables/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if build_application
2222
)
2323

2424
elif meson.is_cross_build() and host_machine.system() == 'switch'
25-
switch_options = [
25+
nintendo_options = [
2626
app_name,
2727
main_files,
2828
[liboopetris_graphics_dep, graphic_application_deps],

src/executables/platforms/switch/meson.build

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

3-
switch_exe_name = switch_options[0]
4-
switch_src_files = switch_options[1]
5-
switch_deps = switch_options[2]
3+
exe_name = nintendo_options[0]
4+
src_files = nintendo_options[1]
5+
deps = nintendo_options[2]
66

77
# libraries
88

9-
switch_dependencies = [
9+
dependencies = [
1010
'harfbuzz',
1111
'egl',
1212
'flac',
@@ -21,7 +21,7 @@ switch_dependencies = [
2121
'zlib',
2222
]
2323

24-
switch_dependencies_native = [
24+
dependencies_native = [
2525
'bz2',
2626
'drm_nouveau',
2727
'modplug',
@@ -30,35 +30,35 @@ switch_dependencies_native = [
3030
'SDL2main',
3131
]
3232

33-
foreach dep : switch_dependencies
34-
switch_deps += dependency(
33+
foreach dep : dependencies
34+
deps += dependency(
3535
dep,
3636
required: true,
3737
allow_fallback: false,
3838
native: false,
3939
)
4040
endforeach
4141

42-
switch_library_dirs = meson.get_external_property('library_dirs', [''])
43-
if switch_library_dirs.length() == 0
42+
library_dirs = meson.get_external_property('library_dirs', [''])
43+
if library_dirs.length() == 0
4444
error('property \'library_dirs\' has to be set!')
4545
endif
4646

4747
c = meson.get_compiler('c')
48-
foreach dep : switch_dependencies_native
49-
switch_deps += c.find_library(
48+
foreach dep : dependencies_native
49+
deps += c.find_library(
5050
dep,
5151
required: true,
52-
dirs: switch_library_dirs,
52+
dirs: library_dirs,
5353
)
5454
endforeach
5555

5656
## compilation
5757

58-
switch_elf_file = build_target(
59-
switch_exe_name + '.elf',
60-
switch_src_files,
61-
dependencies: switch_deps,
58+
elf_file = build_target(
59+
exe_name + '.elf',
60+
src_files,
61+
dependencies: deps,
6262
override_options: {
6363
'warning_level': '3',
6464
'werror': true,
@@ -73,8 +73,8 @@ use_nacp = ['true', 'True', '1', true].contains(
7373

7474
elf2nro = find_program('elf2nro')
7575
# executable input elf file, output nro file
76-
NRO_FLAGS = [elf2nro, switch_elf_file.full_path(), switch_exe_name + '.nro']
77-
NRO_DEPS = [switch_elf_file]
76+
NRO_FLAGS = [elf2nro, elf_file.full_path(), exe_name + '.nro']
77+
NRO_DEPS = [elf_file]
7878
NACP_DEPS = NRO_DEPS
7979

8080
fs = import('fs')
@@ -87,7 +87,7 @@ if use_nacp
8787
oopetris_name,
8888
oopetris_author,
8989
meson.project_version(),
90-
switch_exe_name + '.nacp',
90+
exe_name + '.nacp',
9191
]
9292

9393
APP_TITLEID = meson.get_external_property('APP_TITLEID', '')
@@ -97,16 +97,16 @@ if use_nacp
9797
NACP_FLAGS += '--titleid=' + APP_TITLEID
9898
endif
9999

100-
# nacptool --create <name> <author> <version> <switch_exe_name>.nacp
100+
# nacptool --create <name> <author> <version> <exe_name>.nacp
101101
# optional: --titleid=<titleID>
102102
nacp_file = custom_target(
103-
switch_exe_name + '.nacp',
103+
exe_name + '.nacp',
104104
command: NACP_FLAGS,
105-
output: [switch_exe_name + '.nacp'],
105+
output: [exe_name + '.nacp'],
106106
depends: NACP_DEPS,
107107
)
108108

109-
NRO_FLAGS += '--nacp=' + switch_exe_name + '.nacp'
109+
NRO_FLAGS += '--nacp=' + exe_name + '.nacp'
110110
NRO_DEPS += nacp_file
111111

112112
endif
@@ -116,9 +116,9 @@ if LIBNX == ''
116116
error('property \'libnx\' has to be set!')
117117
endif
118118

119-
switch_default_icon = LIBNX / 'default_icon.jpg'
119+
default_icon = LIBNX / 'default_icon.jpg'
120120

121-
APP_ICON = meson.get_external_property('APP_ICON', switch_default_icon)
121+
APP_ICON = meson.get_external_property('APP_ICON', default_icon)
122122

123123
if not fs.is_absolute(APP_ICON)
124124
APP_ICON = meson.project_source_root() / APP_ICON
@@ -145,11 +145,11 @@ if APP_ROMFS != ''
145145

146146
endif
147147

148-
# elf2nro <switch_exe_name>.elf <switch_exe_name>.nro <NRO_FLAGS>
148+
# elf2nro <exe_name>.elf <exe_name>.nro <NRO_FLAGS>
149149
custom_target(
150-
switch_exe_name + '.nro',
150+
exe_name + '.nro',
151151
command: NRO_FLAGS,
152152
depends: NRO_DEPS,
153-
output: [switch_exe_name + '.nro'],
153+
output: [exe_name + '.nro'],
154154
build_by_default: true,
155155
)

0 commit comments

Comments
 (0)