From 687c6d264f6ed1649eef483d13ef0c90dceee087 Mon Sep 17 00:00:00 2001 From: John Alanbrook Date: Sat, 6 Dec 2025 15:20:40 -0600 Subject: [PATCH] playdate cross file --- Makefile | 4 ++++ emscripten.cross | 28 ++++++++++++++-------------- playdate.cross | 20 ++++++++++++++++++++ 3 files changed, 38 insertions(+), 14 deletions(-) create mode 100644 playdate.cross diff --git a/Makefile b/Makefile index 281e56e0..74ea90c9 100755 --- a/Makefile +++ b/Makefile @@ -34,6 +34,10 @@ crosswin: FORCE meson setup -Dbuildtype=debugoptimized --cross-file mingw32.cross build_win meson compile -C build_win +playdate: FORCE + meson setup -Dbuildtype=debugoptimized --cross-file playdate.cross build_playdate + meson compile -C build_playdate + FORCE: IMAGE_LINUX := prosperon/linux-builder:latest diff --git a/emscripten.cross b/emscripten.cross index 4fbc4693..fab53c11 100644 --- a/emscripten.cross +++ b/emscripten.cross @@ -1,22 +1,22 @@ [binaries] -c = 'emcc' -cpp = 'em++' -ar = 'emar' -strip = 'emstrip' -pkgconfig = 'pkg-config' -exe_wrapper = 'node' +c = 'emcc' +cpp = 'em++' +ar = 'emar' +strip = 'emstrip' +ranlib = 'emranlib' [host_machine] -system = 'emscripten' +system = 'emscripten' cpu_family = 'wasm32' -cpu = 'wasm32' -endian = 'little' +cpu = 'wasm32' +endian = 'little' [built-in options] -pkg_config_path = '/emsdk/upstream/emscripten/cache/sysroot/lib/pkgconfig' -cmake_prefix_path = '/emsdk/upstream/emscripten/cache/sysroot' +c_args = ['-sUSE_PTHREADS=0'] +cpp_args = ['-sUSE_PTHREADS=0'] +c_link_args = ['-sALLOW_MEMORY_GROWTH=1', '-sEXPORTED_RUNTIME_METHODS=ccall,cwrap'] +cpp_link_args = ['-sALLOW_MEMORY_GROWTH=1', '-sEXPORTED_RUNTIME_METHODS=ccall,cwrap'] [properties] -needs_exe_wrapper = true -# <-- Replace with your real path to Emscripten.cmake: -cmake_toolchain_file = '/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake' +needs_exe_wrapper = true +sys_root = '/emsdk/upstream/emscripten/cache/sysroot' diff --git a/playdate.cross b/playdate.cross new file mode 100644 index 00000000..6ee1d28e --- /dev/null +++ b/playdate.cross @@ -0,0 +1,20 @@ +[binaries] +c = 'arm-none-eabi-gcc' +cpp = 'arm-none-eabi-g++' +ar = 'arm-none-eabi-ar' +strip = 'arm-none-eabi-strip' +objcopy = 'arm-none-eabi-objcopy' +ld = 'arm-none-eabi-ld' + +[host_machine] +system = 'none' +cpu_family = 'arm' +cpu = 'cortex-m7' +endian = 'little' + +[properties] +needs_exe_wrapper = true + +[built-in options] +c_args = ['-mcpu=cortex-m7', '-mthumb', '-mfloat-abi=hard', '-mfpu=fpv5-sp-d16', '-fno-exceptions'] +c_link_args = ['-mcpu=cortex-m7', '-mthumb', '-mfloat-abi=hard', '-mfpu=fpv5-sp-d16', '-nostartfiles']