From 62212e65eb6645f40766018d798e3d5414fe6ec6 Mon Sep 17 00:00:00 2001 From: Jon Edwards Date: Wed, 22 Sep 2021 19:03:12 -0700 Subject: [PATCH] make Framework-specific changes for build --- .../Dynamics/Compressor/AKCompressor.swift | 4 +-- .../AKDynamicsProcessor.swift | 4 +-- .../Dynamics/Expander/AKExpander.swift | 4 +-- Frameworks/build_frameworks.sh | 30 +++---------------- Frameworks/simulator.xcconfig | 3 ++ 5 files changed, 13 insertions(+), 32 deletions(-) diff --git a/AudioKit/Common/Nodes/Effects/Dynamics/Compressor/AKCompressor.swift b/AudioKit/Common/Nodes/Effects/Dynamics/Compressor/AKCompressor.swift index d8ed7e12d0..428f3afa03 100644 --- a/AudioKit/Common/Nodes/Effects/Dynamics/Compressor/AKCompressor.swift +++ b/AudioKit/Common/Nodes/Effects/Dynamics/Compressor/AKCompressor.swift @@ -65,7 +65,7 @@ open class AKCompressor: AKNode, AKToggleable, AUEffect, AKInput { @objc open dynamic var masterGain: Double = 0 { didSet { masterGain = (-40...40).clamp(masterGain) - au[kDynamicsProcessorParam_MasterGain] = masterGain + au[kDynamicsProcessorParam_OverallGain] = masterGain } } @@ -135,7 +135,7 @@ open class AKCompressor: AKNode, AKToggleable, AUEffect, AKInput { au[kDynamicsProcessorParam_HeadRoom] = headRoom au[kDynamicsProcessorParam_AttackTime] = attackDuration au[kDynamicsProcessorParam_ReleaseTime] = releaseDuration - au[kDynamicsProcessorParam_MasterGain] = masterGain + au[kDynamicsProcessorParam_OverallGain] = masterGain } public var inputNode: AVAudioNode { diff --git a/AudioKit/Common/Nodes/Effects/Dynamics/Dynamics Processor/AKDynamicsProcessor.swift b/AudioKit/Common/Nodes/Effects/Dynamics/Dynamics Processor/AKDynamicsProcessor.swift index b3214fc2cf..f762032383 100644 --- a/AudioKit/Common/Nodes/Effects/Dynamics/Dynamics Processor/AKDynamicsProcessor.swift +++ b/AudioKit/Common/Nodes/Effects/Dynamics/Dynamics Processor/AKDynamicsProcessor.swift @@ -68,7 +68,7 @@ open class AKDynamicsProcessor: AKNode, AKToggleable, AUEffect, AKInput { @objc open dynamic var masterGain: Double = 0 { didSet { masterGain = (-40...40).clamp(masterGain) - au[kDynamicsProcessorParam_MasterGain] = masterGain + au[kDynamicsProcessorParam_OverallGain] = masterGain } } @@ -174,7 +174,7 @@ open class AKDynamicsProcessor: AKNode, AKToggleable, AUEffect, AKInput { au[kDynamicsProcessorParam_ExpansionThreshold] = expansionThreshold au[kDynamicsProcessorParam_AttackTime] = attackDuration au[kDynamicsProcessorParam_ReleaseTime] = releaseDuration - au[kDynamicsProcessorParam_MasterGain] = masterGain + au[kDynamicsProcessorParam_OverallGain] = masterGain } public var inputNode: AVAudioNode { diff --git a/AudioKit/Common/Nodes/Effects/Dynamics/Expander/AKExpander.swift b/AudioKit/Common/Nodes/Effects/Dynamics/Expander/AKExpander.swift index 488bf215de..07b2e1fa4e 100644 --- a/AudioKit/Common/Nodes/Effects/Dynamics/Expander/AKExpander.swift +++ b/AudioKit/Common/Nodes/Effects/Dynamics/Expander/AKExpander.swift @@ -55,7 +55,7 @@ open class AKExpander: AKNode, AKToggleable, AUEffect, AKInput { @objc open dynamic var masterGain: Double = 0 { didSet { masterGain = (-40...40).clamp(masterGain) - au[kDynamicsProcessorParam_MasterGain] = masterGain + au[kDynamicsProcessorParam_OverallGain] = masterGain } } @@ -145,7 +145,7 @@ open class AKExpander: AKNode, AKToggleable, AUEffect, AKInput { au[kDynamicsProcessorParam_ExpansionThreshold] = expansionThreshold au[kDynamicsProcessorParam_AttackTime] = attackDuration au[kDynamicsProcessorParam_ReleaseTime] = releaseDuration - au[kDynamicsProcessorParam_MasterGain] = masterGain + au[kDynamicsProcessorParam_OverallGain] = masterGain } public var inputNode: AVAudioNode { diff --git a/Frameworks/build_frameworks.sh b/Frameworks/build_frameworks.sh index faf92cd638..46cc3f310e 100755 --- a/Frameworks/build_frameworks.sh +++ b/Frameworks/build_frameworks.sh @@ -164,6 +164,8 @@ create_xcframework() -framework "${BUILD_DIR}/${CONFIGURATION}-appletvos/$1.framework" \ -framework "${BUILD_DIR}/${CONFIGURATION}-appletvsimulator/$1.framework" \ -framework "${BUILD_DIR}/${CONFIGURATION}/$1.framework" $CATA_ARG + # OMFG, we need to manually unfuck the generated swift interface files. WTF! + find $1.xcframework -name "*.swiftinterface" -exec sed -i -e "s/$1\.//g" {} \; } # Create individual static platform frameworks (device or simulator) in their own subdirectories @@ -225,7 +227,7 @@ create_catalyst_framework() rm -rf "${DIR}/${PROJECT_NAME}.framework" "${DIR}/${PROJECT_UI_NAME}.framework" mkdir -p "$DIR" xcodebuild archive -project "$PROJECT" -scheme $PROJECT_UI_NAME ONLY_ACTIVE_ARCH=$ACTIVE_ARCH CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY="" SKIP_INSTALL=NO \ - -configuration ${CONFIGURATION} -destination 'platform=macOS,variant=Mac Catalyst' -archivePath "${BUILD_DIR}/Catalyst.xcarchive" \ + -configuration ${CONFIGURATION} -destination 'platform=macOS,arch=x86_64,variant=Mac Catalyst' -archivePath "${BUILD_DIR}/Catalyst.xcarchive" \ BUILD_DIR="${BUILD_DIR}" AUDIOKIT_VERSION="$VERSION" | tee -a build.log | $XCPRETTY || exit 2 cp -av "${BUILD_DIR}/Catalyst.xcarchive/Products/Library/Frameworks/${PROJECT_NAME}.framework" "${BUILD_DIR}/Catalyst.xcarchive/Products/Library/Frameworks/${PROJECT_UI_NAME}.framework" "$DIR/" if test -d "${BUILD_DIR}/${CONFIGURATION}/${PROJECT_NAME}.framework.dSYM"; @@ -245,28 +247,4 @@ create_catalyst_framework() echo "Building frameworks for version $VERSION on platforms: $PLATFORMS" rm -f build.log -for os in $PLATFORMS; do - if test $os = 'iOS'; then - #create_universal_framework iOS iphonesimulator iphoneos - create_framework iOS iphoneos - create_framework iOS iphonesimulator - elif test $os = 'tvOS'; then - #create_universal_framework tvOS appletvsimulator appletvos - create_framework tvOS appletvos - create_framework tvOS appletvsimulator - elif test $os = 'macOS'; then - create_macos_framework macOS macosx - create_catalyst_framework - fi -done - -# Only create the xcframework if all platforms were built -if test "$PLATFORMS" = "iOS macOS tvOS"; then - create_xcframework AudioKit - create_xcframework AudioKitUI -fi - -if [ -f distribute_built_frameworks.sh ]; then - ./distribute_built_frameworks.sh -fi - +create_universal_framework iOS iphonesimulator iphoneos diff --git a/Frameworks/simulator.xcconfig b/Frameworks/simulator.xcconfig index 2361295330..d8a83f65fc 100644 --- a/Frameworks/simulator.xcconfig +++ b/Frameworks/simulator.xcconfig @@ -7,3 +7,6 @@ CLANG_ENABLE_MODULE_DEBUGGING = NO CODE_SIGNING_REQUIRED = NO CODE_SIGN_IDENTITY = + +EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64=arm64 arm64e armv7 armv7s armv6 armv8 +EXCLUDED_ARCHS=$(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT))