Skip to content

Commit c6004ea

Browse files
committed
use meson.project_version() instead ocf custom version
1 parent 480b7b5 commit c6004ea

File tree

2 files changed

+7
-19
lines changed

2 files changed

+7
-19
lines changed

platforms/build-switch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ libnx='$LIBNX'
101101
102102
APP_NAME = 'oopetris'
103103
APP_AUTHOR = 'coder2k'
104-
APP_VERSION = '0.5.4'
104+
APP_VERSION = true
105105
106106
USE_NACP = true
107107

platforms/switch/meson.build

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

43
switch_exe_name = switch_options[0]
54
switch_src_files = switch_options[1]
65
switch_deps = switch_options[2]
76

8-
97
# libraries
108

119
switch_dependencies = [
@@ -32,7 +30,6 @@ switch_dependencies_native = [
3230
'SDL2main',
3331
]
3432

35-
3633
foreach dep : switch_dependencies
3734
switch_deps += dependency(
3835
dep,
@@ -56,8 +53,6 @@ foreach dep : switch_dependencies_native
5653
)
5754
endforeach
5855

59-
60-
6156
## compilation
6257

6358
switch_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-
8074
elf2nro = find_program('elf2nro')
8175
# executable input elf file, output nro file
8276
NRO_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-
133125
endif
134126

135127
LIBNX = 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
146138
endif
147139

148-
149140
if not fs.exists(APP_ICON)
150141
error('APP_ICON should exist, but doesn\'t: \'' + APP_ICON + '\'')
151142
endif
152143

153-
154-
155144
NRO_FLAGS += '--icon=' + APP_ICON
156145

157-
158146
APP_ROMFS = meson.get_external_property('APP_ROMFS', '')
159147

160148
if APP_ROMFS != ''

0 commit comments

Comments
 (0)