Skip to content

Commit

Permalink
Fix compilation in Xcode 15
Browse files Browse the repository at this point in the history
  • Loading branch information
moffatman committed Nov 21, 2023
1 parent 18cd32f commit 08646fd
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 42 deletions.
16 changes: 8 additions & 8 deletions cross-files/iossimulator-arm64.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ strip = ['strip']
pkgconfig = ['pkg-config']

[built-in options]
c_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0']
cpp_args = ['-stdlib=libc++', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0']
objc_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0']
objcpp_args = ['-stdlib=libc++', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0']
c_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0']
cpp_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0']
objc_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0']
objcpp_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0']
c_args = ['-target', 'arm64-apple-ios-simulator', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0']
cpp_args = ['-target', 'arm64-apple-ios-simulator', '-stdlib=libc++', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0']
objc_args = ['-target', 'arm64-apple-ios-simulator', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0']
objcpp_args = ['-target', 'arm64-apple-ios-simulator', '-stdlib=libc++', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0']
c_link_args = ['-target', 'arm64-apple-ios-simulator', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0']
cpp_link_args = ['-target', 'arm64-apple-ios-simulator', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0']
objc_link_args = ['-target', 'arm64-apple-ios-simulator', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0']
objcpp_link_args = ['-target', 'arm64-apple-ios-simulator', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0']

[properties]
cmake_osx_sysroot = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk'
11 changes: 11 additions & 0 deletions patches/ltmain-target-passthrough.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -7154,7 +7154,7 @@
# Tru64 UNIX uses -model [arg] to determine the layout of C++
# classes, name mangling, and exception handling.
# Darwin uses the -arch flag to determine output architecture.
- -model|-arch|-isysroot|--sysroot)
+ -model|-arch|-isysroot|--sysroot|-target)
func_append compiler_flags " $arg"
func_append compile_command " $arg"
func_append finalize_command " $arg"
2 changes: 2 additions & 0 deletions scripts/libass/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set -u # treat unset variables as an error

cd ${SRC_DIR}

patch -p1 <${PROJECT_DIR}/patches/ltmain-target-passthrough.patch

cp ${PROJECT_DIR}/scripts/libass/meson.build ./meson.build
meson setup build \
--cross-file ${PROJECT_DIR}/cross-files/${OS}-${ARCH}.ini \
Expand Down
2 changes: 2 additions & 0 deletions scripts/libogg/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set -u # treat unset variables as an error

cd ${SRC_DIR}

patch -p1 <${PROJECT_DIR}/patches/ltmain-target-passthrough.patch

cp ${PROJECT_DIR}/scripts/libogg/meson.* .

meson setup build \
Expand Down
4 changes: 0 additions & 4 deletions scripts/libs-arch/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,3 @@ ${PROJECT_DIR}/scripts/libs-arch/relink-dylibs.sh ${PROJECT_DIR} @rpath ${OUTPUT

# remove signatures
codesign --remove ${OUTPUT_DIR}/*.dylib

if [ "${OS}" == "iossimulator" ] && [ "${ARCH}" == "arm64" ]; then
sh ${PROJECT_DIR}/scripts/libs-arch/fix-iossimulator-arm64.sh ${OUTPUT_DIR}
fi
29 changes: 0 additions & 29 deletions scripts/libs-arch/fix-iossimulator-arm64.sh

This file was deleted.

5 changes: 5 additions & 0 deletions scripts/libvorbis/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ set -u # treat unset variables as an error

cd ${SRC_DIR}

patch -p1 <${PROJECT_DIR}/patches/ltmain-target-passthrough.patch

# Fix building on modern macOS
sed -i '' 's/\-force_cpusubtype_ALL//g' configure

cp ${PROJECT_DIR}/scripts/libvorbis/meson.* .

meson setup build \
Expand Down
1 change: 1 addition & 0 deletions scripts/libvorbis/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ p = mod.add_project('configure',
'--prefix=@PREFIX@',
'--disable-static',
'--enable-shared',
'--disable-tests'
],
verbose: true,
)
Expand Down
1 change: 0 additions & 1 deletion scripts/libx264/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ c_args = get_option('c_args')
p = mod.add_project('configure',
configure_options : [
'--prefix=@PREFIX@',
'--disable-static',
'--enable-shared',
'--disable-cli'
],
Expand Down
2 changes: 2 additions & 0 deletions scripts/libxml2/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set -u # treat unset variables as an error

cd ${SRC_DIR}

patch -p1 <${PROJECT_DIR}/patches/ltmain-target-passthrough.patch

cp ${PROJECT_DIR}/scripts/libxml2/meson.build ./meson.build
meson setup build \
--cross-file ${PROJECT_DIR}/cross-files/${OS}-${ARCH}.ini \
Expand Down

0 comments on commit 08646fd

Please sign in to comment.