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 )
4040endforeach
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!' )
4545endif
4646
4747c = 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 )
5454endforeach
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
7474elf2nro = 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 ]
7878NACP_DEPS = NRO_DEPS
7979
8080fs = 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
112112endif
@@ -116,9 +116,9 @@ if LIBNX == ''
116116 error (' property \' libnx\' has to be set!' )
117117endif
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
123123if not fs.is_absolute(APP_ICON)
124124 APP_ICON = meson .project_source_root() / APP_ICON
@@ -145,11 +145,11 @@ if APP_ROMFS != ''
145145
146146endif
147147
148- # elf2nro <switch_exe_name >.elf <switch_exe_name >.nro <NRO_FLAGS>
148+ # elf2nro <exe_name >.elf <exe_name >.nro <NRO_FLAGS>
149149custom_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