1-
21## get the options object and "unpack" it
32
43switch_exe_name = switch_options[0 ]
54switch_src_files = switch_options[1 ]
65switch_deps = switch_options[2 ]
76
8-
97# libraries
108
119switch_dependencies = [
@@ -32,7 +30,6 @@ switch_dependencies_native = [
3230 ' SDL2main' ,
3331]
3432
35-
3633foreach dep : switch_dependencies
3734 switch_deps += dependency (
3835 dep,
@@ -56,8 +53,6 @@ foreach dep : switch_dependencies_native
5653 )
5754endforeach
5855
59-
60-
6156## compilation
6257
6358switch_elf_file = build_target (
@@ -76,7 +71,6 @@ use_nacp = ['true', 'True', '1', true].contains(
7671 meson .get_external_property(' USE_NACP' , '' ),
7772)
7873
79-
8074elf2nro = find_program (' elf2nro' )
8175# executable input elf file, output nro file
8276NRO_FLAGS = [elf2nro, switch_elf_file.full_path(), switch_exe_name + ' .nro' ]
@@ -92,23 +86,23 @@ if use_nacp
9286 APP_NAME = meson .get_external_property(' APP_NAME' , switch_exe_name)
9387 NACP_FLAGS += APP_NAME
9488
95-
9689 APP_AUTHOR = meson .get_external_property(' APP_AUTHOR' , '' )
9790 if APP_AUTHOR == ''
9891 error (' If USE_NACP is set, you have to provide an APP_AUTHOR' )
9992 endif
10093 NACP_FLAGS += APP_AUTHOR
10194
10295 APP_VERSION = meson .get_external_property(' APP_VERSION' , '' )
96+ if APP_VERSION == true
97+ APP_VERSION = meson .project_version()
98+ endif
99+
103100 if APP_VERSION == ''
104101 error (' If USE_NACP is set, you have to provide an APP_VERSION' )
105102 endif
106103 NACP_FLAGS += APP_VERSION
107104
108- NACP_FLAGS += (
109- switch_exe_name + ' .nacp' # outfile
110- )
111-
105+ NACP_FLAGS += (switch_exe_name + ' .nacp' )
112106
113107 APP_TITLEID = meson .get_external_property(' APP_TITLEID' , '' )
114108
@@ -117,8 +111,7 @@ if use_nacp
117111 NACP_FLAGS += ' --titleid=' + APP_TITLEID
118112 endif
119113
120-
121- # nacptool --create <name> <author> <version> <switch_exe_name>.nacp
114+ # nacptool --create <name> <author> <version> <switch_exe_name>.nacp
122115 # optional: --titleid=<titleID>
123116 nacp_file = custom_target (
124117 switch_exe_name + ' .nacp' ,
@@ -129,7 +122,6 @@ if use_nacp
129122 NRO_FLAGS += ' --nacp=' + switch_exe_name + ' .nacp'
130123 NRO_DEPS += nacp_file
131124
132-
133125endif
134126
135127LIBNX = meson .get_external_property(' libnx' , '' )
@@ -145,16 +137,12 @@ if not fs.is_absolute(APP_ICON)
145137 APP_ICON = meson .project_source_root() / APP_ICON
146138endif
147139
148-
149140if not fs.exists(APP_ICON)
150141 error (' APP_ICON should exist, but doesn\' t: \' ' + APP_ICON + ' \' ' )
151142endif
152143
153-
154-
155144NRO_FLAGS += ' --icon=' + APP_ICON
156145
157-
158146APP_ROMFS = meson .get_external_property(' APP_ROMFS' , '' )
159147
160148if APP_ROMFS != ''
0 commit comments