@@ -53,8 +53,6 @@ elif cpp.get_id() == 'clang'
5353 deps += cpp.find_library (' c++abi' )
5454 endif
5555
56-
57-
5856endif
5957
6058if get_option (' buildtype' ) == ' debug' or get_option (' buildtype' ) == ' debugoptimized'
@@ -67,7 +65,7 @@ inc_dirs = []
6765recording_inc_dirs = []
6866
6967only_allow_native_libs = false
70- if ( meson .is_cross_build() )
68+ if meson .is_cross_build()
7169 if host_machine .system() == ' switch'
7270 # we do not link to code that was compiled with gcc 10.1, the code we link with is all compiled with gcc 13.2
7371 compile_args += [' -Wno-psabi' ]
9088 deps += dependency (
9189 ' sdl2' ,
9290 required : true ,
93- fallback : ' sdl2' ,
9491 default_options : {' test' : ' false' },
9592 )
9693 deps += dependency (
@@ -224,11 +221,7 @@ int main() {
224221if not have_std_expected
225222 message (' Compiler doesn\' t support std::expected, using fallback' )
226223 compile_args += [' -D_USE_TL_EXPECTED' ]
227- tl_exp_dep = dependency (
228- ' tl-expected' ,
229- required : true ,
230- fallback : [' tl-expected' ],
231- )
224+ tl_exp_dep = dependency (' tl-expected' , required : true )
232225 recording_dependencies += tl_exp_dep
233226 deps += tl_exp_dep
234227else
@@ -250,11 +243,7 @@ int main() {
250243if not have_std_optional
251244 message (' Compiler doesn\' t support std::optional, using fallback' )
252245 compile_args += [' -D_USE_TL_OPTIONAL' ]
253- tl_opt_dep = dependency (
254- ' tl-optional' ,
255- required : true ,
256- fallback : [' tl-optional' ],
257- )
246+ tl_opt_dep = dependency (' tl-optional' , required : true )
258247 recording_dependencies += tl_opt_dep
259248 deps += tl_opt_dep
260249else
@@ -266,17 +255,12 @@ endif
266255magic_enum_dep = dependency (
267256 ' magic_enum' ,
268257 required : true ,
269- fallback : [' magic_enum' ],
270258 default_options : {' test' : ' false' },
271259)
272260recording_dependencies += magic_enum_dep
273261deps += magic_enum_dep
274262
275- argparse_dep = dependency (
276- ' argparse' ,
277- required : true ,
278- fallback : [' argparse' ],
279- )
263+ argparse_dep = dependency (' argparse' , required : true )
280264recording_dependencies += argparse_dep
281265deps += argparse_dep
282266
289273 deps += dependency (
290274 ' cpp-httplib' ,
291275 required : true ,
292- fallback : [' cpp-httplib' ],
293276 default_options : {
294277 ' cpp-httplib_openssl' : ' enabled' ,
295278 ' cpp-httplib_zlib' : ' enabled' ,
@@ -300,7 +283,6 @@ endif
300283deps += dependency (
301284 ' utf8cpp' ,
302285 required : true ,
303- fallback : [' utfcpp' ],
304286 version : ' >=4.0.0' ,
305287)
306288
@@ -341,14 +323,29 @@ if (meson.is_cross_build() and host_machine.system() == 'switch')
341323
342324endif
343325
326+ is_flatpak_build = get_option (' flatpak_build' )
327+
328+ have_file_dialogs = false
329+
330+ nfde_dep = dependency (
331+ ' nativefiledialog-extended' ,
332+ required : not meson .is_cross_build(),
333+ default_options : {' xdg-desktop-portal' : is_flatpak_build ? ' enabled' : ' auto' },
334+ )
335+ if nfde_dep.found()
336+ have_file_dialogs = true
337+ deps += nfde_dep
338+ compile_args += ' -D_HAVE_FILE_DIALOGS'
339+ endif
340+
344341
345342
346343src_files = []
347344recording_src_files = []
348345
349346subdir (' src' )
350347
351- ## TODO: only istall needed ones, since sometimes we only need e.g. flacs or mp3 and no icons etc.
348+ ## TODO: only install needed ones, since sometimes we only need e.g. flacs or mp3 and no icons etc.
352349## install assets
353350install_subdir (
354351 ' assets' ,
@@ -358,7 +355,7 @@ install_subdir(
358355)
359356
360357app_name = ' oopetris'
361- if get_option ( ' flatpak_build ' )
358+ if is_flatpak_build
362359 app_name = ' com.github.mgerhold.OOPetris'
363360 compile_args += [' -DFLATPAK_BUILD' , ' -DBUILD_INSTALLER' ]
364361endif
@@ -434,7 +431,6 @@ foreach logo : logos
434431 )
435432endforeach
436433
437-
438434if meson .is_cross_build() and host_machine .system() == ' android'
439435
440436 library (
0 commit comments