try my way

This commit is contained in:
Михаил Капелько committed 2026-10-22 18:33:09 +03:00
1 parent 6fecc1e95e
commit fa1cd053c8
16 files changed
+521 -2

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
#!/bin/bash -e
SDIR=$(cd "$(dirname "$0")" ; pwd -P)
T=$SDIR/step
source $SDIR/paths
TARGET=ogs-chkgfx
STEP=0
source $T/generateDialect $TARGET
source $T/prepareIOS $TARGET
cd $SDIR/../$TARGET/ver-ios
xcodebuild -scheme "ogs-chkgfx" -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -derivedDataPath .build build
+26
View File
@@ -0,0 +1,26 @@
#!/bin/bash -e
SDIR=$(cd "$(dirname "$0")" ; pwd -P)
T=$SDIR/step
source $SDIR/paths
TARGET=ogs-chkgfx
BUNDLE_ID=org.opengamestudio.chkgfx
APP="$SDIR/../$TARGET/ver-ios/.build/Build/Products/Debug-iphonesimulator/ogs-chkgfx.app"
if [[ ! -d "$APP" ]]; then
echo "iOS app not built yet, run util/build-ogs-chkgfx-ios"
exit 1
fi
DEVICE=${DEVICE:-"iPhone 15 Pro"}
UDID=$(xcrun simctl list devices available | grep -m1 "$DEVICE (" | sed -E 's/.*\(([0-9A-F-]{36})\).*/\1/')
if [[ -z "$UDID" ]]; then
echo "Simulator '$DEVICE' not found"
exit 1
fi
xcrun simctl boot "$UDID" 2>/dev/null || true
sleep 2
xcrun simctl install "$UDID" "$APP"
xcrun simctl launch "$UDID" "$BUNDLE_ID"
+40
View File
@@ -5,5 +5,45 @@ TARGET=$1
STEP=$((STEP+1))
echo -e "\n> > > > Step №$STEP. Generate iOS project for '$TARGET'"
# iOS rendering goes through ghera/raylib-iOS: a raylib fork that renders
# OpenGL ES via ANGLE (Metal backend). Its stable releases ship prebuilt
# xcframeworks (raylib + libEGL + libGLESv2, ~46 MB), so they are downloaded
# on demand and never committed.
#
# Unlike the fork's own app, ver-ios does not link raylib.xcframework (its
# rcore.o defines main() and a private view controller). We only use its
# headers: raylib's renderer (rlgl) is compiled into components/raybri/ios,
# and EGL/ANGLE provides the GL context.
RAYLIB_IOS_TAG=6.0.7-iOS
FRAMEWORKS=$SDIR/../$TARGET/ver-ios/Frameworks
MISSING=0
for FRAMEWORK in raylib libEGL libGLESv2; do
[[ -d "$FRAMEWORKS/$FRAMEWORK.xcframework" ]] || MISSING=1
done
if [[ $MISSING -eq 1 ]]; then
echo "Raylib iOS xcframeworks missing, downloading $RAYLIB_IOS_TAG..."
mkdir -p "$FRAMEWORKS"
TMP=$(mktemp -d)
curl -sL --retry 3 -o "$TMP/raylib-ios.zip" \
"https://github.com/ghera/raylib-iOS/releases/download/$RAYLIB_IOS_TAG/raylib-ios-xcframeworks-$RAYLIB_IOS_TAG.zip"
unzip -q "$TMP/raylib-ios.zip" -d "$TMP"
cp -R "$TMP/raylib-ios-xcframeworks/raylib.xcframework" "$FRAMEWORKS/"
cp -R "$TMP/raylib-ios-xcframeworks/libEGL.xcframework" "$FRAMEWORKS/"
cp -R "$TMP/raylib-ios-xcframeworks/libGLESv2.xcframework" "$FRAMEWORKS/"
rm -rf "$TMP"
fi
# The ANGLE headers are shipped as framework Headers directories but their
# internal includes expect the `libEGL/...` and `libGLESv2/...` layout, so
# stage symlinks for the header search path. The headers are identical for
# device and simulator, so one slice is enough.
mkdir -p "$FRAMEWORKS/include"
ln -sfn "../libEGL.xcframework/ios-arm64_x86_64-simulator/libEGL.framework/Headers" \
"$FRAMEWORKS/include/libEGL"
ln -sfn "../libGLESv2.xcframework/ios-arm64_x86_64-simulator/libGLESv2.framework/Headers" \
"$FRAMEWORKS/include/libGLESv2"
cd $SDIR/../$TARGET/ver-ios
xcodegen