Skip to content

Commit

Permalink
update and test
Browse files Browse the repository at this point in the history
  • Loading branch information
BB9z committed Jul 6, 2024
1 parent 12dbe96 commit fedd76c
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
./make-xcframework.sh
env:
# Seems unable build visionOS at the moment
B9_BUILD_VISION_OS: false
B9_BUILD_VISION_OS: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This project aims to archive [LAME](https://lame.sourceforge.io) into the xcfram

LAME.xcframework | Build with | macOS | iOS | tvOS | watchOS | visionOS
-----------------|--------------|--------|-------|-------|---------|---------
3.100.1 | Xcode 15.2 | 10.13+ | 12.0+ | 12.0+ | 4.0+ | 1.0+
3.100.2 | Xcode 15.4 | 10.13+ | 12.0+ | 12.0+ | 4.0+ | 1.0+
3.100.0 | Xcode 12.5.1 | 10.10+ | 9.0+ | 9.0+ | 2.0+ | NA

## 集成
Expand Down
8 changes: 0 additions & 8 deletions SwiftPM/dummy.c

This file was deleted.

8 changes: 0 additions & 8 deletions SwiftPM/include/dummy.h

This file was deleted.

3 changes: 2 additions & 1 deletion macosx/Lame-Framework.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = $(CURRENT_PROJECT_VERSION);
DYLIB_INSTALL_NAME_BASE = @rpath;
FRAMEWORK_VERSION = A;
ENABLE_MODULE_VERIFIER = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = LAME_Prefix.pch;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = Info.plist;
LD_RUNPATH_SEARCH_PATHS = @executable_path/Frameworks @loader_path/Frameworks;
MACH_O_TYPE = mh_dylib;
PRODUCT_BUNDLE_IDENTIFIER = net.sourceforge.LAMEframework;
PRODUCT_MODULE_NAME = LAME;
Expand Down
16 changes: 15 additions & 1 deletion macosx/make-xcframework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# Build all platform targets and package them into the xcframework.
# Set `B9_BUILD_VISION_OS` environment variable to 0 can disable building for visionOS.
# Set `B9_BUILD_SYMBOLS` environment variable to 0 can disable including debug symbols in the xcframework.
#
# Copyright © 2021, 2024 BB9z.
# https://github.com/BB9z/LAME-xcframework
Expand Down Expand Up @@ -57,10 +58,14 @@ function xcbuild() {
echo "$PWD"

readonly B9_BUILD_VISION_OS=${B9_BUILD_VISION_OS:=1}
readonly B9_BUILD_SYMBOLS=${B9_BUILD_SYMBOLS:=1}

if [[ $(checkVar "$B9_BUILD_VISION_OS") != 0 ]]; then
echo "Skip building for visionOS."
fi
if [[ $(checkVar "$B9_BUILD_SYMBOLS") != 0 ]]; then
echo "Skip including debug symbols."
fi

## Clean

Expand All @@ -71,6 +76,11 @@ else
echo "No previous build, go on."
fi

if [ -d "build" ]; then
echo "Clean build directory."
rm -r "build"
fi

## Build

xcbuild LAME-macOS "generic/platform=macOS" "build/macOS"
Expand Down Expand Up @@ -105,10 +115,14 @@ fi
packageCmds=("xcodebuild" "-create-xcframework")
for part in "${archivePaths[@]}"; do
packageCmds+=("-framework" "$part/Products/Library/Frameworks/LAME.framework")
if [[ $(checkVar "$B9_BUILD_SYMBOLS") == 0 ]]; then
# -debug-symbols requires full path
packageCmds+=(-debug-symbols "$PWD/$part/dSYMs/LAME.framework.dSYM")
fi
done
packageCmds+=("-output" "LAME.xcframework")

echo "${packageCmds[*]}"
"${packageCmds[@]}"

echo "Done."
echo "Make xcframework done."
4 changes: 3 additions & 1 deletion make-package.command
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ sh ./make-xcframework.sh
cd "$ROOT_DIR"

mv "$ROOT_DIR/macosx/LAME.xcframework" "$ROOT_DIR"
zip -r -9 LAME.xcframework.zip LAME.xcframework LICENSE LICENSE-LAME
zip -r -9 LAME.xcframework.zip LAME.xcframework LICENSE LICENSE-LAME COPYING

checksum=$(swift package compute-checksum LAME.xcframework.zip)
echo "Checksum: $checksum"

echo "✅ Successfully packaged LAME.xcframework at $ROOT_DIR/LAME.xcframework.zip"
1 change: 0 additions & 1 deletion make-xcframwork.command
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

set -euo pipefail
cd "$(dirname "$0")/macosx"
echo "$PWD"

if [ -x "$(command -v xcpretty)" ]; then
sh ./make-xcframework.sh | xcpretty
Expand Down

0 comments on commit fedd76c

Please sign in to comment.