Files
rive-cpp/skia/renderer/build.sh
luigi-rosso 80c037c2d7 Audio engine
Adds an audio engine abstraction (implemented with miniaudio) in Rive. We can selectively replace it with other abstractions later if we find miniaudio isn't well suited everywhere but I'm confident it will be based on flexibility with getting it working in the recorder.

Adds audio support in:

- packages/rive_common
  - WASM: rive_audio_wasm.dart
  - FFI: rive_audio_ffi.dart
- packages/runtime
- packages/recorder

Subsequent PR will add support in:

- packages/rive_unity
  - This is getting meaty enough...
- packages/rive_flutter
  - This requires publishing rive_common so I want to make sure this is reviewed and accepted before publishing
  - I'd also prefer to merge layout constraints into rive_common before this lands.

Editor features:
- Updated preview window:
<img width="248" alt="CleanShot 2024-01-15 at 14 44 31@2x" src="https://github.com/rive-app/rive/assets/454182/a9588be6-8370-4e22-ab32-af1e9ed71183">

- Preview waveforms in the timeline:
<img width="651" alt="CleanShot 2024-01-15 at 14 44 53@2x" src="https://github.com/rive-app/rive/assets/454182/2710667f-838f-483d-9647-e2bcb9e0237a">

- Subsequent PR will also use threads in web editor build (currently uses a time/frame based decoder to offload ui). I can't do that until I can verify the Shared Memory access is granted once rive_common lands in pub.dev and then we can push to UAT.

Diffs=
73bf11db3 Audio engine (#6454)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2024-01-23 04:11:42 +00:00

98 lines
2.4 KiB
Bash
Executable File

#!/bin/bash
set -e
export SKIA_DIR="${SKIA_DIR_NAME:-skia}"
source ../../dependencies/config_directories.sh
# build main rive
cd ../..
./build.sh "$@"
# build skia renderer
cd skia/renderer
pushd build &>/dev/null
while getopts p: flag; do
case "${flag}" in
p)
shift 2
platform=${OPTARG}
;;
\?) help ;;
esac
done
# make sure argument is lowercase
OPTION="$(echo "$1" | tr '[A-Z]' '[a-z]')"
help() {
echo build.sh - build debug library
echo build.sh clean - clean the build
echo build.sh release - build release library
echo build.sh -p ios release - build release ios library
echo build.sh -p ios_sim release - build release ios simulator library
echo build.sh -p android release - build release android library
exit 1
}
if [ "$OPTION" = 'help' ]; then
help
else
build() {
echo "Building Rive Renderer for platform=$platform option=$OPTION"
PREMAKE="premake5 --scripts=../../../build gmake2 --with_rive_text --with_rive_audio=system $1"
eval "$PREMAKE"
if [ "$OPTION" = "clean" ]; then
make clean
make clean config=release
elif [ "$OPTION" = "release" ]; then
make config=release -j7
else
make -j7
fi
}
case $platform in
ios)
echo "Building for iOS"
export IOS_SYSROOT=$(xcrun --sdk iphoneos --show-sdk-path)
build "--os=ios"
if [ "$OPTION" = "clean" ]; then
exit
fi
;;
ios_sim)
echo "Building for iOS Simulator"
export IOS_SYSROOT=$(xcrun --sdk iphonesimulator --show-sdk-path)
build "--os=ios --variant=emulator"
if [ "$OPTION" = "clean" ]; then
exit
fi
;;
# Android supports ABIs via a custom platform format:
# e.g. 'android.x86', 'android.x64', etc.
android*)
echo "Building for ${platform}"
# Extract ABI from this opt by splitting on '.' character
IFS="." read -ra strarr <<<"$platform"
ARCH=${strarr[1]}
build "--os=android --arch=${ARCH}"
;;
macosx)
echo "Building for macos"
export MACOS_SYSROOT=$(xcrun --sdk macosx --show-sdk-path)
build "--os=macosx --variant=runtime"
if [ "$OPTION" = "clean" ]; then
exit
fi
;;
*)
build
;;
esac
fi
popd &>/dev/null