Open BrianTopp opened 1 year ago
I'm going to look into this further but it looks like Visual Studio was getting in the way on my end.. I switched the generator to "Unix Makefiles" and built successfully
C:\Users\xnor\dev\rnbo.unity.audioplugin\build>cmake .. -DANDROID_PLATFORM=29 -DANDROID_ABI=arm64-v8a -DCMAKE_TOOLCHAIN_FILE="C:\Program Files\Unity\Hub\Editor\2021.3.16f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\build\cmake/android.toolchain.cmake" -DRNBO_EXPORT_DIR="Z:\Documents\export\sync-cycle" -DRNBO_CPP_DIR="Z:\Documents\export\sync-cycle\rnbo" -DPLUGIN_NAME="Sync Cycle" -G"Unix Makefiles"
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Unity/Hub/Editor/2021.3.16f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- building for Android with bit depth 64 for CPU ARM64
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/xnor/dev/rnbo.unity.audioplugin/build
C:\Users\xnor\dev\rnbo.unity.audioplugin\build>cmake --build .
[ 20%] Building CXX object CMakeFiles/RNBOUnityPlugin.dir/src/RNBOWrapper.cpp.o
[ 40%] Building CXX object CMakeFiles/RNBOUnityPlugin.dir/src/AudioPluginUtil.cpp.o
[ 60%] Building CXX object CMakeFiles/RNBOUnityPlugin.dir/Z_/Documents/export/sync-cycle/rnbo_source.cpp.o
[ 80%] Building CXX object CMakeFiles/RNBOUnityPlugin.dir/Z_/Documents/export/sync-cycle/rnbo/RNBO.cpp.o
[100%] Linking CXX shared module SyncCycle/Assets/Plugins/Android/arm64-v8a/libSyncCycle.so
[100%] Built target RNBOUnityPlugin
for future reference: https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-android
and the examples for calling cmake on the commandline for NDK builds on windows use Ninja
https://developer.android.com/studio/projects/configure-cmake#call-cmake-cli
@BrianTopp interesting, I added some notes RE my experience with building for Android on windows: https://github.com/Cycling74/rnbo.unity.audioplugin#notes-for-cross-compiling-for-android-on-windows
I am also running VS 2022 and I don't see those same issues RE the locks. Here is my commandline for reference:
C:\Users\xnor\dev\rnbo.unity.audioplugin\build-vs>cmake .. -DANDROID_PLATFORM=29 -DANDROID_ABI=arm64-v8a -DCMAKE_TOOLCHAIN_FILE="C:\Program Files\Unity\Hub\Editor\2021.3.16f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\build\cmake/android.toolchain.cmake" -DRNBO_EXPORT_DIR="Z:\Documents\export\sync-cycle" -DRNBO_CPP_DIR="Z:\Documents\export\sync-cycle\rnbo" -DPLUGIN_NAME="Sync Cycle" -DANDROID_CPP_FEATURES=exceptions
-- Building for: Visual Studio 17 2022
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Unity/Hub/Editor/2021.3.16f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- building for Android with bit depth 64 for CPU ARM64
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/xnor/dev/rnbo.unity.audioplugin/build-vs
C:\Users\xnor\dev\rnbo.unity.audioplugin\build-vs>cmake --build .
MSBuild version 17.5.0+6f08c67f3 for .NET Framework
ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
ANDROID_SDK_ROOT=C:\Program Files (x86)\Android\android-sdk
ANT_HOME=
JAVA_HOME=C:\Program Files\Android\jdk\jdk-8.0.302.8-hotspot\jdk8u302-b08
NDK_ROOT=C:\\Microsoft\AndroidNDK\android-ndk-r23c
Checking Build System
ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
ANDROID_SDK_ROOT=C:\Program Files (x86)\Android\android-sdk
ANT_HOME=
JAVA_HOME=C:\Program Files\Android\jdk\jdk-8.0.302.8-hotspot\jdk8u302-b08
NDK_ROOT=C:\\Microsoft\AndroidNDK\android-ndk-r23c
Building Custom Rule C:/Users/xnor/dev/rnbo.unity.audioplugin/CMakeLists.txt
RNBOUnityPlugin.vcxproj -> C:\Users\xnor\dev\rnbo.unity.audioplugin\build-vs\SyncCycle\Assets\Plugins\Android\arm64-v8a\libSyncCycle.so
ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
ANDROID_SDK_ROOT=C:\Program Files (x86)\Android\android-sdk
ANT_HOME=
JAVA_HOME=C:\Program Files\Android\jdk\jdk-8.0.302.8-hotspot\jdk8u302-b08
NDK_ROOT=C:\\Microsoft\AndroidNDK\android-ndk-r23c
Building Custom Rule C:/Users/xnor/dev/rnbo.unity.audioplugin/CMakeLists.txt
Thanks! Yeah, after your previous comments I switched to using Ninja, and that seems to have solved all build issues on my end. I'm not sure what the issue with VS 2022 was. It looks like the only difference in what you've just posted is the "-DANDROID_CPP_FEATURES=exceptions", but I've tried recompiling with that argument and am still getting the same lock errors. I'll continue to use Ninja as that works well. Thanks for your help!
Hello,
I submitted this through the Cycling 74 support, and they asked me to also post this here.
I’m struggling to get RNBO plugins to properly compile for Unity Android. I’ve been able to compile for Mac and PC (on respective platforms) but am unable to compile the same patches for Unity Android. I’ve been following along with the github docs but keep running into the same issue where it appears as though all of the files are created properly in the initial step, but then when building I get a number of errors that appear to be related to the RNBOWrapper.cpp. I’ve included the output errors below, which hopefully you can make sense of. I also fully understand that this repo is still in an experimental stage, so mainly want to draw attention to the issues and see if there is a current solution, or if perhaps there was some issue with my approach.
Thanks!
steps : Following the build steps on the RNBO Unity Audio Plugin repo, specifically for Android building
notes : This is console output, including the commands I inputted to start the build process:
PS E:\Repos\RNBO Unity Plugins\RNBO Build SRC\build> cmake .. -DANDROID_ABI=arm64-v8a -DCMAKE_TOOLCHAIN_FILE="C:\Program Files\Unity\Hub\Editor\2022.2.0f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\build\cmake\android.toolchain.cmake" -DPLUGIN_NAME="MyChorus" -DANDROID_PLATFORM=29 -DPLUGIN_UNITY_PLATFORM_NAME=Android -- Building for: Visual Studio 17 2022 -- Android: Targeting API '29' with architecture 'arm64', ABI 'arm64-v8a', and processor 'aarch64' -- Android: Selected unified Clang toolchain -- The CXX compiler identification is unknown -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files/Unity/Hub/Editor/2022.2.0f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe - skipped -- building for Android with bit depth 64 for CPU ARM64 -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) -- Configuring done (3.2s) -- Generating done (0.0s) -- Build files have been written to: E:/Repos/RNBO Unity Plugins/RNBO Build SRC/build PS E:\Repos\RNBO Unity Plugins\RNBO Build SRC\build> cmake --build . MSBuild version 17.5.0+6f08c67f3 for .NET Framework
ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk ANDROID_SDK_ROOT=C:\Program Files (x86)\Android\android-sdk ANT_HOME= JAVA_HOME=C:\Program Files\Android\jdk\jdk-8.0.302.8-hotspot\jdk8u302-b08 NDK_ROOT=C:\Microsoft\AndroidNDK\android-ndk-r23c Checking Build System ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk ANDROID_SDK_ROOT=C:\Program Files (x86)\Android\android-sdk ANT_HOME= JAVA_HOME=C:\Program Files\Android\jdk\jdk-8.0.302.8-hotspot\jdk8u302-b08 NDK_ROOT=C:\Microsoft\AndroidNDK\android-ndk-r23c Building Custom Rule E:/Repos/RNBO Unity Plugins/RNBO Build SRC/CMakeLists.txt RNBOWrapper.cpp In file included from:380:
(1,9): warning : '__ANDROID_API__' macro redefined [-Wmacro-redefined] [E:\Repos\RNBO Unity Plugins\RNBO Build SRC\build\RNBOUnityPlugin.vcxproj]
define __ANDROID_API__ 29
^