@@ -67,7 +67,9 @@ if meson.is_cross_build()
6767 foreach native_dependency_tuple : map_native_dependencies
6868 native_dep_lib_name = native_dependency_tuple[0 ]
6969
70- native_dep_name = native_dependency_tuple.length() == 2 ? native_dependency_tuple[1 ] : native_dep_lib_name
70+ native_dep_name = (
71+ native_dependency_tuple.length() == 2 ? native_dependency_tuple[1 ] : native_dep_lib_name
72+ )
7173
7274 native_dep = cpp.find_library (native_dep_lib_name, required : true )
7375
@@ -102,13 +104,12 @@ if meson.is_cross_build()
102104
103105 native_dep_with_version = declare_dependency (
104106 dependencies : native_dep,
105- version : major_version
106- + ' . '
107- + minor_version
108- + ' . '
109- + patch_version ,
107+ version : major_version + ' . ' + minor_version + ' . ' + patch_version,
108+ )
109+ meson .override_dependency(
110+ native_dep_name,
111+ native_dep_with_version ,
110112 )
111- meson .override_dependency(native_dep_name, native_dep_with_version)
112113 else
113114 meson .override_dependency(native_dep_name, native_dep)
114115
@@ -146,7 +147,8 @@ fmt_use_header_only = false
146147
147148if (
148149 meson .is_cross_build()
149- and (host_machine .system() == ' switch' or host_machine .system() == ' 3ds' )
150+ and (host_machine .system() == ' switch'
151+ or host_machine .system() == ' 3ds' )
150152)
151153 fmt_use_header_only = true
152154endif
@@ -350,7 +352,10 @@ if build_application
350352
351353 if (meson .is_cross_build() and host_machine .system() == ' 3ds' )
352354 graphics_lib += {
353- ' compile_args' : [graphics_lib.get(' compile_args' ), ' -DSPDLOG_NO_TLS' ],
355+ ' compile_args' : [
356+ graphics_lib.get(' compile_args' ),
357+ ' -DSPDLOG_NO_TLS' ,
358+ ],
354359 }
355360 endif
356361
@@ -407,8 +412,16 @@ if build_application
407412
408413 endif
409414
410- if host_machine .system() == ' linux' or (meson .is_cross_build() and host_machine .system() == ' android' )
411- keyutils_dep = dependency (' keyutils' , required : true , allow_fallback : true )
415+ if (
416+ host_machine .system() == ' linux'
417+ or (meson .is_cross_build()
418+ and host_machine .system() == ' android' )
419+ )
420+ keyutils_dep = dependency (
421+ ' keyutils' ,
422+ required : true ,
423+ allow_fallback : true ,
424+ )
412425 graphics_lib += {' deps' : [graphics_lib.get(' deps' ), keyutils_dep]}
413426 elif host_machine .system() == ' windows'
414427 c = meson .get_compiler(' c' )
@@ -425,8 +438,8 @@ if build_application
425438 if build_installer
426439 if get_option (' buildtype' ) != ' release'
427440 error (
428- ' buildtype needs to be \' release\' , when building the installer, but was: '
429- + get_option (' buildtype' ),
441+ ' buildtype needs to be \' release\' , when building the installer, but was: ' +
442+ get_option (' buildtype' ),
430443 )
431444 endif
432445
@@ -435,16 +448,15 @@ if build_application
435448 is_flatpak_build = true
436449 else
437450 error (
438- ' only support flatpak builds, when building the installer for linux' ,
451+ ' only support flatpak builds, when building the installer for linux' ,
439452 )
440453 endif
441454 elif host_machine .system() == ' windows'
442455 message (' Adding a windows installer target: \' windows_installer\' ' )
443456 else
444457 # TODO: create a proper installer for macOS : https://mesonbuild.com/Creating-OSX-packages.html
445458 error (
446- ' unsupported system for building the installer: '
447- + host_machine .system(),
459+ ' unsupported system for building the installer: ' + host_machine .system(),
448460 )
449461
450462 endif
@@ -466,7 +478,7 @@ if build_application
466478 endif
467479
468480 have_file_dialogs = false
469- have_discord_sdk = false
481+ have_discord_social_sdk = false
470482
471483 nfde_dep = dependency (
472484 ' nativefiledialog-extended' ,
@@ -489,29 +501,33 @@ if build_application
489501
490502 c = meson .get_compiler(' c' )
491503
492- discord_dep_required = not meson .is_cross_build() and get_option (' build_installer' )
504+ discord_dep_required = (
505+ not meson .is_cross_build()
506+ and get_option (' build_installer' )
507+ )
493508
494- if host_machine .system() == ' linux' and host_machine .cpu_family() == ' aarch64'
509+ if (
510+ host_machine .system() == ' linux'
511+ and host_machine .cpu_family() == ' aarch64'
512+ )
495513 # not supported on aarch64 linux :(
496514 discord_dep_required = false
497515 endif
498516
499- discord_sdk_dep = dependency (
500- ' discord-game -sdk' ,
517+ discord_social_sdk_dep = dependency (
518+ ' discord-social -sdk' ,
501519 allow_fallback : true ,
502520 required : discord_dep_required,
503- # only with msvc we need a static library, all others work without adding __declspec() everywhere
504- static : c.get_id() == ' msvc' ,
505- default_options : c.get_id() != ' msvc' ? {} : {' default_library' : ' static' },
506521 )
507- if discord_sdk_dep.found()
508- have_discord_sdk = true
522+
523+ if discord_social_sdk_dep.found()
524+ have_discord_social_sdk = true
509525 graphics_lib += {
510526 ' compile_args' : [
511527 graphics_lib.get(' compile_args' ),
512- ' -D_HAVE_DISCORD_SDK ' ,
528+ ' -D_HAVE_DISCORD_SOCIAL_SDK ' ,
513529 ],
514- ' deps' : [graphics_lib.get(' deps' ), discord_sdk_dep ],
530+ ' deps' : [graphics_lib.get(' deps' ), discord_social_sdk_dep ],
515531 }
516532 endif
517533
0 commit comments