Browse Source

fix1

lizzie/ios-port-sud
lizzie 2 weeks ago
parent
commit
94dcf09617
  1. 1
      .ci/ios/build.sh
  2. 2
      CMakeLists.txt
  3. 11
      docs/Caveats.md
  4. 6
      externals/cmake-modules/DetectPlatform.cmake
  5. 7
      externals/ffmpeg/CMakeLists.txt

1
.ci/ios/build.sh

@ -26,7 +26,6 @@ cmake -G Xcode -B build \
-DYUZU_CMD=OFF \ -DYUZU_CMD=OFF \
-DUSE_DISCORD_PRESENCE=OFF \ -DUSE_DISCORD_PRESENCE=OFF \
-DYUZU_USE_EXTERNAL_FFMPEG=ON \ -DYUZU_USE_EXTERNAL_FFMPEG=ON \
-DYUZU_USE_CPM=ON \
-DYUZU_USE_EXTERNAL_SDL2=ON \ -DYUZU_USE_EXTERNAL_SDL2=ON \
-DCPMUTIL_FORCE_BUNDLED=ON \ -DCPMUTIL_FORCE_BUNDLED=ON \
-DCMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_TYPE=Release

2
CMakeLists.txt

@ -283,7 +283,7 @@ if (YUZU_ROOM)
add_compile_definitions(YUZU_ROOM) add_compile_definitions(YUZU_ROOM)
endif() endif()
if ((ANDROID OR APPLE OR UNIX) AND (NOT PLATFORM_LINUX OR ANDROID) AND NOT WIN32)
if ((ANDROID OR APPLE OR UNIX OR IOS) AND (NOT PLATFORM_LINUX OR ANDROID) AND NOT WIN32)
if(CXX_APPLE OR CXX_CLANG) if(CXX_APPLE OR CXX_CLANG)
# libc++ has stop_token and jthread as experimental # libc++ has stop_token and jthread as experimental
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexperimental-library") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexperimental-library")

11
docs/Caveats.md

@ -4,6 +4,7 @@
- [Arch Linux](#arch-linux) - [Arch Linux](#arch-linux)
- [Gentoo Linux](#gentoo-linux) - [Gentoo Linux](#gentoo-linux)
- [macOS](#macos) - [macOS](#macos)
- [iOS](#ios)
- [Solaris](#solaris) - [Solaris](#solaris)
- [HaikuOS](#haikuos) - [HaikuOS](#haikuos)
- [OpenBSD](#openbsd) - [OpenBSD](#openbsd)
@ -31,6 +32,16 @@ If you're having issues with building, always consult that ebuild.
macOS is largely untested. Expect crashes, significant Vulkan issues, and other fun stuff. macOS is largely untested. Expect crashes, significant Vulkan issues, and other fun stuff.
## iOS
iOS has a dedicated build script, we **highly** recommend using that instead of doing anything else, we don't support any other configuration than the one present in said build script.
To build, it's simply as easy as doing
```sh
chmod +x .ci/ios/build.sh
.ci/ios/build.sh
```
## Solaris ## Solaris
Always consult [the OpenIndiana package list](https://pkg.openindiana.org/hipster/en/index.shtml) to cross-verify availability. Always consult [the OpenIndiana package list](https://pkg.openindiana.org/hipster/en/index.shtml) to cross-verify availability.

6
externals/cmake-modules/DetectPlatform.cmake

@ -51,6 +51,12 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
set(CXX_APPLE ON) set(CXX_APPLE ON)
endif() endif()
# This fixes some quirks with xcrun or weird iOS toolchain cmake files
if (IOS)
unser(CXX_CLANG)
set(CXX_APPLE ON)
endif()
# https://gitlab.kitware.com/cmake/cmake/-/merge_requests/11112 # https://gitlab.kitware.com/cmake/cmake/-/merge_requests/11112
# This works totally fine on MinGW64, but not CLANG{,ARM}64 # This works totally fine on MinGW64, but not CLANG{,ARM}64
if(MINGW AND CXX_CLANG) if(MINGW AND CXX_CLANG)

7
externals/ffmpeg/CMakeLists.txt

@ -203,15 +203,16 @@ else()
) )
elseif(IOS) elseif(IOS)
execute_process(COMMAND xcrun --sdk iphoneos --show-sdk-path OUTPUT_VARIABLE SYSROOT) execute_process(COMMAND xcrun --sdk iphoneos --show-sdk-path OUTPUT_VARIABLE SYSROOT)
# Lovely extra newline apple adds that **we** must remove... thank you apple!
string(STRIP "${SYSROOT}" SYSROOT)
set(FFmpeg_CC xcrun --sdk iphoneos clang -arch arm64) set(FFmpeg_CC xcrun --sdk iphoneos clang -arch arm64)
set(FFmpeg_CXX xcrun --sdk iphoneos clang++ -arch arm64) set(FFmpeg_CXX xcrun --sdk iphoneos clang++ -arch arm64)
list(APPEND FFmpeg_CROSS_COMPILE_FLAGS list(APPEND FFmpeg_CROSS_COMPILE_FLAGS
--arch=arm64 --arch=arm64
--enable-cross-compile --enable-cross-compile
--sysroot=${SYSROOT}
--target-os=darwin
--sysroot="${SYSROOT}"
--extra-ldflags="-miphoneos-version-min=16.0" --extra-ldflags="-miphoneos-version-min=16.0"
--install-name-dir="@rpath"
--install-name-dir='@rpath'
--disable-audiotoolbox --disable-audiotoolbox
) )
endif() endif()

Loading…
Cancel
Save