improve build scripts
This commit is contained in:
@@ -29,7 +29,8 @@ public class AndroidPostProcess : IPostGenerateGradleAndroidProject
|
||||
|
||||
// 4. Prepare the command
|
||||
string commandName = "my_plugin_build";
|
||||
string lineToAdd = $"\nadd_subdirectory(\"{relativePathToMyCpp}\" \"{commandName}\")\n";
|
||||
string unityRoot = EditorApplication.applicationContentsPath;
|
||||
string lineToAdd = $"\nset(UNITY_ROOT \"{unityRoot}\")\nadd_subdirectory(\"{relativePathToMyCpp}\" \"{commandName}\")\n";
|
||||
|
||||
// 5. Prevent multiple additions
|
||||
string currentContent = File.ReadAllText(targetCmakeFile);
|
||||
|
||||
@@ -6,11 +6,14 @@ find_library(log-lib log)
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
set(PLUGIN_API "/Applications/Unity/Hub/Editor/6000.3.2f1/Unity.app/Contents/PluginAPI")
|
||||
set(ANDROID_SDK "/Users/omar/Library/Android/sdk")
|
||||
message(STATUS "AAA-${UNITY_ROOT}")
|
||||
message(STATUS "AAA-${UNITY_PROJECT_DIR}")
|
||||
message(STATUS "AAA-${ANDROID_SDK}")
|
||||
|
||||
set(PLUGIN_API "${UNITY_ROOT}/PluginAPI")
|
||||
set(BINDER_DIR "${ANDROID_SDK}/platforms/android-36/optional/libbinder_ndk_cpp")
|
||||
|
||||
set(SHARED_SRC_DIR "/Users/omar/Desktop/NativeService/src/main/cpp/")
|
||||
set(SHARED_SRC_DIR "${UNITY_PROJECT_DIR}/../MosisService/src/main/cpp/")
|
||||
add_library(my_native_lib SHARED
|
||||
my_native_code.cpp
|
||||
${SHARED_SRC_DIR}/com/omixlab/mosis/IMosisService.cpp
|
||||
|
||||
Reference in New Issue
Block a user