Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation in Xcode 15 #26

Merged
merged 4 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: 1 addition & 1 deletion scripts/ffmpeg/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ objc = meson.get_compiler('objc')
nm = find_program('nm')
ar = find_program('ar')
strip = find_program('strip')
pkg_config = find_program('pkgconfig')
pkg_config = find_program('pkg-config')

# build options
c_args = get_option('c_args')
Expand Down
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