Create hello-platform for macOS (#10)

Co-authored-by: Михаил Капелько <kornerr@gmail.com>
This commit is contained in:
kornerr authored and Михаил Капелько committed 2026-11-01 05:01:36 +01:00
1 parent 8913022044
commit 1aa218d0bb
186 files changed
+519 -7

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
#!/bin/bash -e
TARGET=$1
STEP=$((STEP+1))
echo -e "\n> > > > Step №$STEP. Build '$TARGET' for macOS"
if [[ -z "${RAYLIB_PREFIX:-}" ]]; then
RAYLIB_PREFIX="$(HOMEBREW_NO_AUTO_UPDATE=1 brew --prefix raylib 2>/dev/null)"
fi
export RAYLIB_PREFIX
echo "Raylib: $RAYLIB_PREFIX"
cd $SDIR/../$TARGET/ver-mac
swift build
+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash -e
DEP="raylib-ios-xcframeworks"
STEP=$((STEP+1))
echo -e "\n> > > > Step №$STEP. Check $DEP presence"
MISSING=0
[[ -e $SDIR/../../$RAYLIB_IOS ]] || MISSING=1
[[ -e $SDIR/../../$RAYLIB_IOS_EGL ]] || MISSING=1
[[ -e $SDIR/../../$RAYLIB_IOS_GLES ]] || MISSING=1
if [[ $MISSING -eq 1 ]]; then
echo "ERROR $DEP not found alongside this project"
exit 1
fi
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash -e
TARGET=$1
STEP=$((STEP+1))
echo -e "\n> > > > Step №$STEP. Generate Dialect for '$TARGET'"
$SDIR/../../dialect/util/run-generator --file=$SDIR/../$TARGET/dialect.yml
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash -e
TARGET=$1
STEP=$((STEP+1))
echo -e "\n> > > > Step №$STEP. Generate iOS project for '$TARGET'"
cd $SDIR/../$TARGET/ver-ios
xcodegen
+18
View File
@@ -0,0 +1,18 @@
#!/bin/bash -e
TARGET=$1
APP_NAME=$2
STEP=$((STEP+1))
echo -e "\n> > > > Step №$STEP. Make '$APP_NAME' macOS package for '$TARGET'"
APP_MAC="$SDIR/../$TARGET/ver-mac/.build/$APP_NAME.app"
rm -rf "$APP_MAC"
APP_DAT="$APP_MAC/Contents"
mkdir -p "$APP_DAT/MacOS"
mkdir -p "$APP_DAT/Resources"
cp $SDIR/../$TARGET/ver-mac/.build/debug/$TARGET "$APP_DAT/MacOS/$TARGET"
cp $SDIR/../$TARGET/ver-mac/Info.plist "$APP_DAT/Info.plist"
# Copy resources with symlink dereferencing
cp -R -L $SDIR/../$TARGET/ver-mac/res/* "$APP_DAT/Resources/"
+22
View File
@@ -0,0 +1,22 @@
#!/bin/bash -e
TARGET=$1
STEP=$((STEP+1))
echo -e "\n> > > > Step №$STEP. Prepare ANGLE includes for '$TARGET'"
BUILD=$SDIR/../$TARGET/ver-ios/.build
INC=$BUILD/include
LIB=$BUILD/lib
mkdir -p $INC $LIB
# Create EGL and GLES symlinks because their internal includes refer to each other
# without knowing of XCFramework bounderies
ln -sfn "$SDIR/../../$RAYLIB_IOS_EGL/ios-arm64_x86_64-simulator/libEGL.framework/Headers" "$INC/libEGL"
ln -sfn "$SDIR/../../$RAYLIB_IOS_GLES/ios-arm64_x86_64-simulator/libGLESv2.framework/Headers" "$INC/libGLESv2"
# Symlink libraries for convenience, too
ln -sfn "$SDIR/../../$RAYLIB_IOS" "$LIB"
ln -sfn "$SDIR/../../$RAYLIB_IOS_EGL" "$LIB"
ln -sfn "$SDIR/../../$RAYLIB_IOS_GLES" "$LIB"
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash -e
TARGET=$1
APP_NAME=$2
STEP=$((STEP+1))
echo -e "\n> > > > Step №$STEP. Run macOS app for '$TARGET'"
"$SDIR/../$TARGET/ver-mac/.build/$APP_NAME.app/Contents/MacOS/$TARGET"