diff --git a/examples/platform/vsgandroidnative/README.md b/examples/platform/vsgandroidnative/README.md index cf071588..b56f9a99 100644 --- a/examples/platform/vsgandroidnative/README.md +++ b/examples/platform/vsgandroidnative/README.md @@ -20,6 +20,8 @@ This example demonstates how to create a window, load assests and render a scene 4. At the bottom of the file add the path to your cmake directory (v3.13) like so cmake.dir=/usr/local/Cellar/cmake/3.13.0 5. Open /app/build.gradle and change the '-Dvsg_DIR' path in the cmake arguments section to point to your Android VSG install path. + * Alternatively, edit app/cpp/CMakeLists.txt and add replace find_package(vsg) with add_subdirectory(/path/to/VulkanSceneGraph vsg). This will build vsg from source, as part of the Android app's CMake project + * Note that when using -Dvsg_DIR or CMAKE_PREFIX_PATH on Android, only paths within the Android sysroot are allowed by default. You can use find_package(vsg NO_CMAKE_FIND_ROOT_PATH) to override this behaviour 6. Build the application diff --git a/examples/platform/vsgandroidnative/app/build.gradle b/examples/platform/vsgandroidnative/app/build.gradle index 4982d588..0e8a1eec 100755 --- a/examples/platform/vsgandroidnative/app/build.gradle +++ b/examples/platform/vsgandroidnative/app/build.gradle @@ -10,10 +10,7 @@ android { externalNativeBuild { cmake { version "3.13.0" - arguments '-DCMAKE_SYSTEM_NAME="Android', '-DCMAKE_SYSTEM_VERSION=24', '-DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a', '-DANDROID_STL=c++_static', '-Dvsg_DIR=/usr/local/android/lib/cmake/vsg' - } - ndk { - abiFilters 'armeabi-v7a' + arguments '-DANDROID_STL=c++_static' } } } diff --git a/examples/platform/vsgandroidnative/app/cpp/CMakeLists.txt b/examples/platform/vsgandroidnative/app/cpp/CMakeLists.txt index 32a583f0..4b8363f7 100755 --- a/examples/platform/vsgandroidnative/app/cpp/CMakeLists.txt +++ b/examples/platform/vsgandroidnative/app/cpp/CMakeLists.txt @@ -21,7 +21,8 @@ target_include_directories(vsgnative PRIVATE ${ANDROID_NDK}/sources/android/native_app_glue) # find vsg -find_package(vsg REQUIRED) +# find_package(vsg REQUIRED) +add_subdirectory(/path/to/VulkanSceneGraph vsg) # add lib dependencies target_link_libraries(vsgnative diff --git a/examples/platform/vsgandroidnative/app/cpp/main.cpp b/examples/platform/vsgandroidnative/app/cpp/main.cpp index 9fd256da..bdf80c45 100755 --- a/examples/platform/vsgandroidnative/app/cpp/main.cpp +++ b/examples/platform/vsgandroidnative/app/cpp/main.cpp @@ -21,7 +21,7 @@ struct AppData { struct android_app* app; - vsg::ref_ptr traits; + vsg::ref_ptr traits; vsg::ref_ptr viewer; vsg::ref_ptr window; diff --git a/examples/platform/vsgandroidnative/build.gradle b/examples/platform/vsgandroidnative/build.gradle index 4e99eeb8..157ec5d4 100755 --- a/examples/platform/vsgandroidnative/build.gradle +++ b/examples/platform/vsgandroidnative/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.2.1' + classpath 'com.android.tools.build:gradle:7.3.0' } } diff --git a/examples/platform/vsgandroidnative/gradle/wrapper/gradle-wrapper.properties b/examples/platform/vsgandroidnative/gradle/wrapper/gradle-wrapper.properties index d604c726..8710f01c 100755 --- a/examples/platform/vsgandroidnative/gradle/wrapper/gradle-wrapper.properties +++ b/examples/platform/vsgandroidnative/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sun Feb 05 19:39:12 IST 2017 +#Thu Nov 17 20:42:48 GMT 2022 distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip +zipStoreBase=GRADLE_USER_HOME