Fry3DX 0.5: builds for Windows, Linux and Android, a phone layout, Apache 2.0

- Apache License 2.0
- Windows: cross-built with clang-cl (cmake --preset windows), a window
  program with its icon; Linux: a portable preset (SDL and the C++
  library inside); Android: android/build_apk.py makes the APK
- tools/package.py packs the downloads; a GitHub workflow builds all
  three and makes a release for a v* tag
- A phone layout (fry_touch, on by default on Android): the UI drawn
  bigger, panels when asked for, a bar of big buttons, one finger to
  turn the view, two to move and pinch, a long press for a right-click;
  files through the phone's file picker
- Settings and autosaves now in a Nexoniarz folder (copied over once)
- README rewritten, the website shows the downloads and the phone

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NMSrd5oe1GpUD7E6d825KP
This commit is contained in:
Nexoniarz 2026-10-19 22:05:01 +02:00
commit f6f5e5f288
40 changed files with 1180 additions and 158 deletions

View file

@ -45,8 +45,14 @@ if(KEEL_YAPF_DIR)
endif()
set(VOLK_PULL_IN_VULKAN OFF)
set(SDL_SHARED ON)
set(SDL_STATIC OFF)
if(FRY_PORTABLE) # (SDL inside the program: one file to run; it opens X11, Wayland and sound itself)
set(FETCHCONTENT_TRY_FIND_PACKAGE_MODE NEVER)
set(SDL_SHARED OFF)
set(SDL_STATIC ON)
else()
set(SDL_SHARED ON)
set(SDL_STATIC OFF)
endif()
set(GLM_BUILD_TESTS OFF)
set(ZSTD_BUILD_PROGRAMS OFF)
set(ZSTD_BUILD_SHARED OFF)

14
cmake/toolchains/clang-cl-xwin Executable file
View file

@ -0,0 +1,14 @@
#!/bin/sh
# clang-cl with the MSVC CRT + Windows SDK from xwin, for every project in the build (sub-builds
# replaces CMake's flags, so they can't live there). LIB is read by lld-link when clang-cl links.
# Headers are made case-insensitive through a VFS overlay (made once, next to the SDK).
X="${XWIN_DIR:-$HOME/.xwin}"
O="$X/case-overlay.json"
[ -f "$O" ] || python3 "$(dirname "$0")/make-case-overlay.py" "$X" "$O"
# clang's own headers (stddef.h's offsetof, intrinsics) must come before the CRT's.
R="${KEEL_CLANG_INCLUDE:-$(clang-cl -print-resource-dir)/include}"
export LIB="$X/crt/lib/x86_64;$X/sdk/lib/um/x86_64;$X/sdk/lib/ucrt/x86_64"
export LIB="$LIB;$X/case-libs"
exec clang-cl --target=x86_64-pc-windows-msvc -fms-compatibility-version=19.40 -fuse-ld=lld-link -D_CRT_USE_BUILTIN_OFFSETOF -Xclang -ivfsoverlay -Xclang "$O" \
/imsvc"$R" /imsvc"$X/crt/include" /imsvc"$X/sdk/include/ucrt" /imsvc"$X/sdk/include/um" /imsvc"$X/sdk/include/shared" /imsvc"$X/sdk/include/winrt" \
"$@"

6
cmake/toolchains/lld-link-xwin Executable file
View file

@ -0,0 +1,6 @@
#!/bin/sh
X="${XWIN_DIR:-$HOME/.xwin}"
# Libraries some MSVC objects name in other cases than the SDK's files (tzdb.obj: "Advapi32").
C="$X/case-libs"
[ -e "$C/Advapi32.lib" ] || { mkdir -p "$C" && ln -sf "$X/sdk/lib/um/x86_64/advapi32.lib" "$C/Advapi32.lib"; }
exec lld-link /libpath:"$X/crt/lib/x86_64" /libpath:"$X/sdk/lib/um/x86_64" /libpath:"$X/sdk/lib/ucrt/x86_64" /libpath:"$C" "$@"

View file

@ -0,0 +1,26 @@
#!/usr/bin/env python3
"""Writes a clang VFS overlay that makes the xwin CRT/SDK headers case-insensitive (Windows code
includes <Winsock2.h>, <WinSock2.h>, <winsock2.h>... and Linux filesystems care)."""
import json, os, sys
root, out = sys.argv[1], sys.argv[2]
dirs = ["crt/include", "sdk/include/ucrt", "sdk/include/um", "sdk/include/shared", "sdk/include/winrt"]
def tree(path):
entries = []
for name in sorted(os.listdir(path)):
full = os.path.join(path, name)
if os.path.islink(full) and name.lower() == os.readlink(full).lower():
continue # xwin's lowercase alias: the overlay covers every casing already
if os.path.isdir(full):
entries.append({"type": "directory", "name": name, "contents": tree(full)})
else:
entries.append({"type": "file", "name": name, "external-contents": os.path.realpath(full)})
return entries
overlay = {"version": 0, "case-sensitive": "false", "overlay-relative": False,
"roots": [{"type": "directory", "name": os.path.join(root, d), "contents": tree(os.path.join(root, d))} for d in dirs]}
tmp = out + f".{os.getpid()}"
with open(tmp, "w") as f:
json.dump(overlay, f)
os.replace(tmp, out)

View file

@ -0,0 +1,30 @@
# Cross-compiling for Windows (x64) from Linux with clang-cl + lld-link against the real MSVC CRT
# and Windows SDK, laid out by xwin:
# xwin --accept-license --arch x86_64 splat --output ~/.xwin
# cmake --preset windows && cmake --build --preset windows
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_VERSION 10.0)
set(CMAKE_SYSTEM_PROCESSOR AMD64)
set(CMAKE_C_COMPILER ${CMAKE_CURRENT_LIST_DIR}/clang-cl-xwin)
set(CMAKE_CXX_COMPILER ${CMAKE_CURRENT_LIST_DIR}/clang-cl-xwin)
set(CMAKE_LINKER ${CMAKE_CURRENT_LIST_DIR}/lld-link-xwin)
set(CMAKE_AR llvm-lib)
set(CMAKE_RC_COMPILER llvm-rc)
set(CMAKE_MT llvm-mt)
set(CMAKE_CXX_FLAGS_INIT "/EHsc")
if(DEFINED ENV{XWIN_DIR})
set(XWIN "$ENV{XWIN_DIR}")
else()
set(XWIN "$ENV{HOME}/.xwin")
endif()
set(CMAKE_RC_FLAGS_INIT "-I${XWIN}/sdk/include/um -I${XWIN}/sdk/include/shared")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_CROSSCOMPILING_EMULATOR wine)
# Never pick up the build machine's libraries (e.g. a Linux SDL3): fetch and build everything.
set(CMAKE_FIND_ROOT_PATH "${XWIN}")
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(FETCHCONTENT_TRY_FIND_PACKAGE_MODE NEVER)