Switch to cmake

This commit is contained in:
Roland Rabien 2023-08-23 08:45:23 -07:00
commit 1a375b0ad5
19 changed files with 1083 additions and 1007 deletions

View file

@ -3,19 +3,13 @@
PLUGIN="Wavetable"
# linux specific stiff
if [ $OS = "linux" ]; then
export GDK_BACKEND=x11
if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
sudo apt-get update
sudo apt-get install clang git ladspa-sdk freeglut3-dev g++ libasound2-dev libcurl4-openssl-dev libfreetype6-dev libjack-jackd2-dev libx11-dev libxcomposite-dev libxcursor-dev libxinerama-dev libxrandr-dev mesa-common-dev webkit2gtk-4.0 juce-tools xvfb
Xvfb :99 &
export DISPLAY=:99
sleep 5
sudo apt-get install clang git ninja-build ladspa-sdk freeglut3-dev g++ libasound2-dev libcurl4-openssl-dev libfreetype6-dev libjack-jackd2-dev libx11-dev libxcomposite-dev libxcursor-dev libxinerama-dev libxrandr-dev mesa-common-dev webkit2gtk-4.0 juce-tools xvfb
fi
# mac specific stuff
if [ $OS = "mac" ]; then
if [ "$(uname)" == "Darwin" ]; then
# Create a temp keychain
if [ -n "$GITHUB_ACTIONS" ]; then
echo "Create a keychain"
@ -41,109 +35,84 @@ ROOT=$(cd "$(dirname "$0")/.."; pwd)
cd "$ROOT"
echo "$ROOT"
BRANCH=${GITHUB_REF##*/}
echo "$BRANCH"
cd "$ROOT/ci"
rm -Rf bin
mkdir bin
# Get the hash
cd "$ROOT/modules/juce"
HASH=`git rev-parse HEAD`
echo "Hash: $HASH"
# Get the Projucer
cd "$ROOT/ci/bin"
while true
do
PROJUCER_URL=$(curl -s -S "https://projucer.rabien.com/get_projucer.php?hash=$HASH&os=$OS&key=$APIKEY")
echo "Response: $PROJUCER_URL"
if [[ $PROJUCER_URL == http* ]]; then
curl -s -S $PROJUCER_URL -o "$ROOT/ci/bin/Projucer.zip"
unzip Projucer.zip
break
fi
sleep 15
done
# Resave jucer file
if [ "$OS" = "mac" ]; then
"$ROOT/ci/bin/Projucer.app/Contents/MacOS/Projucer" --resave "$ROOT/plugin/$PLUGIN.jucer"
elif [ "$OS" = "linux" ]; then
"$ROOT/ci/bin/Projucer" --resave "$ROOT/plugin/$PLUGIN.jucer"
else
"$ROOT/ci/bin/Projucer.exe" --resave "$ROOT/plugin/$PLUGIN.jucer"
fi
# Build mac version
if [ "$OS" = "mac" ]; then
cd "$ROOT/plugin/Builds/MacOSX"
xcodebuild -configuration Release || exit 1
if [ "$(uname)" == "Darwin" ]; then
cd "$ROOT"
cmake --preset xcode
cmake --build --preset xcode --config Release
cp -R ~/Library/Audio/Plug-Ins/VST/$PLUGIN.vst "$ROOT/ci/bin"
cp -R ~/Library/Audio/Plug-Ins/Components/$PLUGIN.component "$ROOT/ci/bin"
cp -R "$ROOT/Builds/xcode/${PLUGIN}_artefacts/Release/AU/$PLUGIN.component" "$ROOT/ci/bin"
cp -R "$ROOT/Builds/xcode/${PLUGIN}_artefacts/Release/VST/$PLUGIN.vst" "$ROOT/ci/bin"
cp -R "$ROOT/Builds/xcode/${PLUGIN}_artefacts/Release/VST3/$PLUGIN.vst3" "$ROOT/ci/bin"
cd "$ROOT/ci/bin"
for filename in ./*.vst; do
codesign -s "$DEV_APP_ID" -v "$filename" --options=runtime --timestamp
done
for filename in ./*.component; do
codesign -s "$DEV_APP_ID" -v "$filename" --options=runtime --timestamp
done
# Build notarize tool
cd "$ROOT/modules/gin/tools/notarize"
"$ROOT/ci/bin/Projucer.app/Contents/MacOS/Projucer" --set-global-search-path osx defaultJuceModulePath "$ROOT/modules/juce/modules"
"$ROOT/ci/bin/Projucer.app/Contents/MacOS/Projucer" --resave "notarize.jucer"
cd Builds/MacOSX
xcodebuild -configuration Release || exit 1
cd build/Release
cp notarize "$ROOT/ci/bin"
codesign -s "$DEV_APP_ID" -v $PLUGIN.vst --options=runtime --timestamp --force
codesign -s "$DEV_APP_ID" -v $PLUGIN.vst3 --options=runtime --timestamp --force
codesign -s "$DEV_APP_ID" -v $PLUGIN.component --options=runtime --timestamp --force
# Notarize
cd "$ROOT/ci/bin"
zip -r ${PLUGIN}_Mac.zip $PLUGIN.vst $PLUGIN.component
zip -r ${PLUGIN}_Mac.zip $PLUGIN.vst $PLUGIN.vst3 $PLUGIN.component
"$ROOT/ci/bin/notarize" -ns ${PLUGIN}_Mac.zip $APPLE_USER $APPLE_PASS com.figbug.$PLUGIN.vst
if [[ -n "$APPLE_USER" ]]; then
xcrun notarytool submit --verbose --apple-id "$APPLE_USER" --password "$APPLE_PASS" --team-id "3FS7DJDG38" --wait --timeout 30m ${PLUGIN}_Mac.zip
fi
rm ${PLUGIN}_Mac.zip
xcrun stapler staple $PLUGIN.vst
xcrun stapler staple $PLUGIN.vst3
xcrun stapler staple $PLUGIN.component
zip -r ${PLUGIN}_Mac.zip $PLUGIN.vst $PLUGIN.component
curl -F "files=@${PLUGIN}_Mac.zip" "https://socalabs.com/files/set.php?key=$APIKEY"
zip -r ${PLUGIN}_Mac.zip $PLUGIN.vst $PLUGIN.vst3 $PLUGIN.component
if [ "$BRANCH" = "release" ]; then
curl -F "files=@${PLUGIN}_Mac.zip" "https://socalabs.com/files/set.php?key=$APIKEY"
fi
fi
# Build linux version
if [ "$OS" = "linux" ]; then
cd "$ROOT/plugin/Builds/LinuxMakefile"
make CONFIG=Release
if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
cd "$ROOT"
cmake --preset ninja-gcc
cmake --build --preset ninja-gcc --config Release
cd "$ROOT/plugin/Builds/LinuxMakefile"
cp ./build/$PLUGIN.so "$ROOT/ci/bin"
cp -R "$ROOT/Builds/ninja-gcc/${PLUGIN}_artefacts/Release/LV2/$PLUGIN.lv2" "$ROOT/ci/bin"
cp -R "$ROOT/Builds/ninja-gcc/${PLUGIN}_artefacts/Release/VST/lib$PLUGIN.so" "$ROOT/ci/bin/$PLUGIN.so"
cp -R "$ROOT/Builds/ninja-gcc/${PLUGIN}_artefacts/Release/VST3/$PLUGIN.vst3" "$ROOT/ci/bin"
cd "$ROOT/ci/bin"
rm -Rf ${PLUGIN}_Linux.zip
zip -r ${PLUGIN}_Linux.zip $PLUGIN.so
curl -F "files=@${PLUGIN}_Linux.zip" "https://socalabs.com/files/set.php?key=$APIKEY"
# Upload
cd "$ROOT/ci/bin"
zip -r ${PLUGIN}_Linux.zip $PLUGIN.so $PLUGIN.vst3 $PLUGIN.lv2
if [ "$BRANCH" = "release" ]; then
curl -F "files=@${PLUGIN}_Linux.zip" "https://socalabs.com/files/set.php?key=$APIKEY"
fi
fi
# Build Win version
if [ "$OS" = "win" ]; then
VS_WHERE="C:/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe"
MSBUILD_EXE=$("$VS_WHERE" -latest -requires Microsoft.Component.MSBuild -find "MSBuild\**\Bin\MSBuild.exe")
echo $MSBUILD_EXE
if [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
cd "$ROOT"
cd "$ROOT/plugin/Builds/VisualStudio2019"
"$MSBUILD_EXE" "$PLUGIN.sln" "//p:VisualStudioVersion=16.0" "//m" "//t:Build" "//p:Configuration=Release64" "//p:Platform=x64" "//p:PreferredToolArchitecture=x64"
"$MSBUILD_EXE" "$PLUGIN.sln" "//p:VisualStudioVersion=16.0" "//m" "//t:Build" "//p:Configuration=Release" "//p:PlatformTarget=x86" "//p:PreferredToolArchitecture=x64"
cmake --preset vs
cmake --build --preset vs --config Release
cd "$ROOT/ci/bin"
cp "$ROOT/plugin/Builds/VisualStudio2019/x64/Release64/VST/${PLUGIN}.dll" .
cp "$ROOT/plugin/Builds/VisualStudio2019/Win32/Release/VST/${PLUGIN}_32b.dll" .
cp -R "$ROOT/Builds/vs/${PLUGIN}_artefacts/Release/VST/$PLUGIN.dll" "$ROOT/ci/bin"
cp -R "$ROOT/Builds/vs/${PLUGIN}_artefacts/Release/VST3/$PLUGIN.vst3" "$ROOT/ci/bin"
7z a ${PLUGIN}_Win.zip ${PLUGIN}.dll ${PLUGIN}_32b.dll
7z a ${PLUGIN}_Win.zip $PLUGIN.dll $PLUGIN.vst3
curl -F "files=@${PLUGIN}_Win.zip" "https://socalabs.com/files/set.php?key=$APIKEY"
fi
if [ "$BRANCH" = "release" ]; then
curl -F "files=@${PLUGIN}_Win.zip" "https://socalabs.com/files/set.php?key=$APIKEY"
fi
fi

16
ci/config_cmake.sh Executable file
View file

@ -0,0 +1,16 @@
#!/bin/bash -e
ROOT=$(cd "$(dirname "$0")/.."; pwd)
cd "$ROOT"
export PATH=$PATH:"/c/Program Files/CMake/bin"
if [ "$(uname)" == "Darwin" ]; then
TOOLCHAIN="xcode"
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
TOOLCHAIN="ninja-gcc"
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
TOOLCHAIN="vs"
fi
cmake --preset $TOOLCHAIN -D BUILD_EXTRAS=OFF -D JUCE_COPY_PLUGIN_AFTER_BUILD=ON