@@ -33,6 +33,9 @@ global_args += '-DHAVE_NANOSLEEP'
3333# ====================
3434
3535if is_libretro
36+ is_vita = core_is_static and host_cpu_family == ' arm' and compilers[' c' ].has_header_symbol(' sys/config.h' , ' __vita__' )
37+ is_devkitarm = core_is_static and host_cpu_family == ' arm' and not is_vita
38+
3639 embedtool = executable (' embedtool' , sources : ' embedtool.cpp' , native : true , override_options : [' buildtype=release' , ' b_coverage=false' , ' b_lto=false' , ' b_ndebug=false' , ' b_pgo=off' , ' b_sanitize=none' ])
3740
3841 libretro_stage1_path = get_option (' libretro_stage1_path' )
@@ -61,6 +64,18 @@ if is_libretro
6164 error (' LTO is required when building for PowerPC architectures. Please pass either `-Db_lto=true` or `-Druby_lto=true` to Meson.' )
6265 endif
6366
67+ if is_devkitarm
68+ compilers[' c' ].has_argument(' -march=armv6k' , required : true )
69+ compilers[' cpp' ].has_argument(' -march=armv6k' , required : true )
70+ libretro_cflags += ' -march=armv6k'
71+ libretro_cppflags += ' -march=armv6k'
72+
73+ compilers[' c' ].has_argument(' -mtune=mpcore' , required : true )
74+ compilers[' cpp' ].has_argument(' -mtune=mpcore' , required : true )
75+ libretro_cflags += ' -mtune=mpcore'
76+ libretro_cppflags += ' -mtune=mpcore'
77+ endif
78+
6479 if host_cpu_family == ' ppc64'
6580 if compilers[' c' ].has_argument(' -m64' )
6681 libretro_cflags += ' -m64'
@@ -70,6 +85,11 @@ if is_libretro
7085 endif
7186 endif
7287
88+ if core_is_static and host_cpu_family == ' arm'
89+ libretro_cflags += ' -mfloat-abi=hard'
90+ libretro_cppflags += ' -mfloat-abi=hard'
91+ endif
92+
7393 # When targeting Emscripten, we need to build a relocatable object
7494 if is_emscripten
7595 compilers[' cpp' ].has_link_argument(' -r' , required : true )
@@ -269,7 +289,7 @@ if is_libretro
269289 # Please submit a full bug report,
270290 # with preprocessed source if appropriate.
271291 # See <https://gcc.gnu.org/bugs/> for instructions.
272- if compilers[ ' c ' ].has_header_symbol( ' sys/config.h ' , ' __vita__ ' )
292+ if is_vita
273293 libretro_defines += ' -DFLAC__INTEGER_ONLY_LIBRARY'
274294 endif
275295
0 commit comments