Fix Android build with vulkan validation layers
This commit is contained in:
+15
-2
@@ -127,7 +127,6 @@ android {
|
|||||||
'-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON',
|
'-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON',
|
||||||
'-DCMAKE_EXPORT_COMPILE_COMMANDS=ON',
|
'-DCMAKE_EXPORT_COMPILE_COMMANDS=ON',
|
||||||
'-DCMAKE_ANDROID_ASSETS_DIRECTORIES=' + layout.buildDirectory.dir("assets").get().asFile,
|
'-DCMAKE_ANDROID_ASSETS_DIRECTORIES=' + layout.buildDirectory.dir("assets").get().asFile,
|
||||||
'-DCMAKE_ANDROID_LIB_DIRECTORIES=' + layout.buildDirectory.dir("libs").get().asFile,
|
|
||||||
'-DWIVRN_USE_SYSTEM_BOOST=OFF',
|
'-DWIVRN_USE_SYSTEM_BOOST=OFF',
|
||||||
'-DWIVRN_USE_SYSTEM_FREETYPE=OFF',
|
'-DWIVRN_USE_SYSTEM_FREETYPE=OFF',
|
||||||
'-DWIVRN_USE_ANDROID_BIN_LIBKTX=ON',
|
'-DWIVRN_USE_ANDROID_BIN_LIBKTX=ON',
|
||||||
@@ -202,12 +201,26 @@ android {
|
|||||||
initWith debug
|
initWith debug
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
cmake {
|
cmake {
|
||||||
arguments '-DUSE_ANDROID_VALIDATION_LAYER=ON'
|
arguments '-DWIVRN_USE_ANDROID_VALIDATION_LAYER=ON'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buildTypes.all { variant ->
|
||||||
|
sourceSets {
|
||||||
|
"${variant.name}" {
|
||||||
|
jniLibs.srcDirs layout.buildDirectory.dir("libs${variant.name.capitalize()}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
externalNativeBuild{
|
||||||
|
cmake {
|
||||||
|
arguments '-DANDROID_LIB_DIRECTORIES=' + layout.buildDirectory.dir("libs${variant.name.capitalize()}").get().asFile
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
manifest.srcFile 'AndroidManifest.xml'
|
manifest.srcFile 'AndroidManifest.xml'
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ khronos_validation.enables = VK_VALIDATION_FEATURE_ENABLE_THREAD_SAFETY_EXT
|
|||||||
")
|
")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(USE_ANDROID_VALIDATION_LAYER)
|
if(WIVRN_USE_ANDROID_VALIDATION_LAYER)
|
||||||
set(VVL_VERSION "1.4.321.0")
|
set(VVL_VERSION "1.4.321.0")
|
||||||
|
|
||||||
if(NOT EXISTS ${FETCHCONTENT_BASE_DIR}/Vulkan-ValidationLayers-${VVL_VERSION}.zip)
|
if(NOT EXISTS ${FETCHCONTENT_BASE_DIR}/Vulkan-ValidationLayers-${VVL_VERSION}.zip)
|
||||||
@@ -213,10 +213,10 @@ if(USE_ANDROID_VALIDATION_LAYER)
|
|||||||
|
|
||||||
file(COPY
|
file(COPY
|
||||||
${FETCHCONTENT_BASE_DIR}/Vulkan-ValidationLayer/android-binaries-${VVL_VERSION}/${CMAKE_ANDROID_ARCH_ABI}
|
${FETCHCONTENT_BASE_DIR}/Vulkan-ValidationLayer/android-binaries-${VVL_VERSION}/${CMAKE_ANDROID_ARCH_ABI}
|
||||||
DESTINATION ${CMAKE_ANDROID_LIB_DIRECTORIES})
|
DESTINATION ${ANDROID_LIB_DIRECTORIES})
|
||||||
else()
|
else()
|
||||||
# silence "Manually-specified variables were not used by the project" warning
|
# silence "Manually-specified variables were not used by the project" warning
|
||||||
set(_unused ${CMAKE_ANDROID_LIB_DIRECTORIES})
|
set(_unused ${ANDROID_LIB_DIRECTORIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user