godotengine / godot-docs

Godot Engine official documentation
https://docs.godotengine.org
Other
3.76k stars 3.06k forks source link

"Cross-compiling for iOS on Linux" Not up-to-date documentation and assembly problem #3341

Open Valeryn4 opened 4 years ago

Valeryn4 commented 4 years ago

Godot version: 3.2+

OS/device including version: iPhone all and Linux Ubuntu 18 LTE

Issue description: Apple does not provide a “DMG” file. They provide a "XIP" file. Need instructions on how to unpack XIP

I asked a friend from his MacBook, the source code of the SDK Xcode. Build error:

[100%] can't set the modifiy times in output file: [100%] can't set the modifiy times in output file: /home/valeryn/dev/godot/bin/libgodot.iphone.opt.arm64.a.RzuwDG (No such file or directory)
[100%] scons: *** Error 1
[100%]  warnings generated.
[100%] /home/valeryn/dev/iostoolchain/usr/bin/arm-apple-darwin11-ar rc bin/libgodot_camera_module.iphone.opt.arm64.a modules/camera/register_types.iphone.opt.arm64.o modules/camera/camera_ios.iphone.opt.arm64.o
[100%] /home/valeryn/dev/iostoolchain/usr/bin/arm-apple-darwin11-ranlib bin/libgodot_camera_module.iphone.opt.arm64.a
[100%] 23 warnings generated.
[100%] /home/valeryn/dev/iostoolchain/usr/bin/arm-apple-darwin11-ar rc bin/libgodot_arkit_module.iphone.opt.arm64.a modules/arkit/register_types.iphone.opt.arm64.o modules/arkit/arkit_interface.iphone.opt.arm64.o modules/arkit/arkit_session_delegate.iphone.opt.arm64.o
[100%] /home/valeryn/dev/iostoolchain/usr/bin/arm-apple-darwin11-ranlib bin/libgodot_arkit_module.iphone.opt.arm64.a
[100%] scons: done building targets.

This file on this path is available: /home/valeryn/dev/godot/bin/libgodot.iphone.opt.arm64.a.RzuwDG

Other modules are built without error.

I use such a script:

#!/bin/bash
GODOT_FOLDER=$1
echo "GODOT_FOLDER = $1"
TARGET=$2
echo "TARGET = $2"
THREADS=$3
echo "THREADS = $3"
IPHONE_SDK="${HOME}/dev/IPhoneSDK/iPhoneOS9.1.sdk"
echo "IPHONE_SDK=${IPHONE_SDK}"
IPHONE_SDK_ARMv7="${HOME}/dev/cctools-port/usage_examples/ios_toolchain/target/SDK/iPhoneOS9.1.sdk"
echo "IPHONE_SDK_ARMv7=${IPHONE_SDK_ARMv7}"
IPHONE_PATH="${HOME}/dev/iostoolchain"
echo "IHPHONE_PATH=${IPHONE_PATH}"
IPHONE_PATH_ARMv7="${HOME}/dev/iostoolchain_armv7"
echo "IHPHONE_PATH_ARMv7=${IPHONE_PATH_ARMv7}"
LIPO="${IPHONE_PATH}/usr/bin/arm-apple-darwin11-lipo"
echo "LIPO=${LIPO}"
FLAGS="tools=no game_center=no store_kit=no debug_symbols=no module_arkit_enabled=no disable_3d=yes disable_advanced_gui=yes no_editor_splash=yes deprecated=no optimize=size"
echo "${FLAGS}"
cd $GODOT_FOLDER
scons -j ${THREADS} platform=iphone IPHONESDK="${IPHONE_SDK_ARMv7}" IPHONEPATH="${IPHONE_PATH_ARMv7}" ios_triple="arm-apple-darwin11-" --help

scons -j ${THREADS} platform=iphone arch=arm target=$TARGET IPHONESDK="${IPHONE_SDK_ARMv7}" IPHONEPATH="${IPHONE_PATH_ARMv7}" ios_triple="arm-apple-darwin11-" ${FLAGS} 
scons -j ${THREADS} platform=iphone arch=arm64 target=$TARGET IPHONESDK="${IPHONE_SDK}" IPHONEPATH="${IPHONE_PATH}" ios_triple="arm-apple-darwin11-" ${FLAGS} 

$LIPO -create bin/libgodot.iphone.opt.$TARGET.arm.a bin/libgodot.iphone.opt.$TARGET.arm64.a -output bin/libgodot.iphone.$TARGET.fat.a 
$LIPO -create bin/libgodot_camera_module.iphone.opt.$TARGET.arm.a bin/libgodot_camera_module.iphone.opt.$TARGET.arm64.a -output bin/libgodot_camera_module.iphone.$TARGET.fat.a 
$LIPO -create bin/libgodot_arkit_module.iphone.opt.$TARGET.arm.a bin/libgodot_arkit_module.iphone.opt.$TARGET.arm64.a -output bin/libgodot_arkit_module.iphone.$TARGET.fat.a 

$ ~/dev/build.sh ~/godot release 4

akien-mga commented 4 years ago

Your SDK version is too old for ARKit support (and for publishing any game on the current App Store).

Valeryn4 commented 4 years ago

Your SDK version is too old for ARKit support (and for publishing any game on the current App Store).

This is the latest version of the SDK.

ARKit success:

[100%] /home/valeryn/dev/iostoolchain/usr/bin/arm-apple-darwin11-ar rc bin/libgodot_arkit_module.iphone.opt.arm64.a modules/arkit/register_types.iphone.opt.arm64.o modules/arkit/arkit_interface.iphone.opt.arm64.o modules/arkit/arkit_session_delegate.iphone.opt.arm64.o
[100%] /home/valeryn/dev/iostoolchain/usr/bin/arm-apple-darwin11-ranlib bin/libgodot_arkit_module.iphone.opt.arm64.a

The problem with the main module.

[100%] can't set the modifiy times in output file: [100%] can't set the modifiy times in output file: /home/valeryn/dev/godot/bin/libgodot.iphone.opt.arm64.a.RzuwDG (No such file or directory)
[100%] scons: *** Error 1
akien-mga commented 4 years ago

You're targeting SDK 9 here:

IPHONE_SDK="${HOME}/dev/IPhoneSDK/iPhoneOS9.1.sdk"
Valeryn4 commented 4 years ago

Application\Xcode.app\Developer\Platforms\iPhoneOS.platform\Developer\SDKs\iPhoneOS.sdk* Application\Xcode.app\Developer\Toolchains\XcodeDefault.xctoolchain\usr\include\c++* I copied from the last Xcode. I copied it directly from the macbook

I acted according to the instructions, targeting IOS 9.1 In the last build, I disabled Arkit: module_arkit_enabled=no But the problem persists

Valeryn4 commented 4 years ago

ARKit is going to a separate module. This module are not part of the main library.

Valeryn4 commented 4 years ago

I am now rebuilding SDK for version 13.0. I’ll tell you exactly in an hour. But there is a problem in the documentation, it is too old.

Valeryn4 commented 4 years ago

ERROR:

fatal error: /home/valeryn/dev/iostoolchain_13.0_arm64/usr/bin/arm-apple-darwin11-libtool: can't set the modifiy times in output file: /home/valeryn/dev/godot/bin/libgodot.iphone.opt.arm64.a.91AfEM (No such file or directory)
scons: *** Error 1
[100%] scons: done building targets.

If you just rename this file, everything seems to work ... (need testing)

build.sh ~/dev/IPhoneSDK/iPhoneOS13.0.sdk.tar.xz arm64 cp bin to iostoolchain_13.0_arm64/usr/

build script:


#!/bin/bash
GODOT_FOLDER=$1
echo "GODOT_FOLDER = $1"
TARGET=$2
echo "TARGET = $2"
THREADS=$3
echo "THREADS = $3"
IPHONE_SDK="${HOME}/dev/IPhoneSDK/iPhoneOS13.0.sdk"
echo "IPHONE_SDK=${IPHONE_SDK}"
IPHONE_PATH_ARM64="${HOME}/dev/iostoolchain_13.0_arm64"
echo "IPHONE_PATH_ARM64=${IPHONE_PATH_ARM64}"

FLAGS="tools=no game_center=no store_kit=no debug_symbols=no module_arkit_enabled=no disable_3d=yes disable_advanced_gui=yes no_editor_splash=yes deprecated=no optimize=size"
echo "${FLAGS}"
cd $GODOT_FOLDER

scons -j ${THREADS} platform=iphone arch=arm64 target=$TARGET IPHONESDK="${IPHONE_SDK}" IPHONEPATH="${IPHONE_PATH_ARM64}" ios_triple="arm-apple-darwin11-" ${FLAGS} 
mirh commented 2 days ago

Presumably can be closed?