Skip to content

Commit

Permalink
Add Android NDK Vulkan validation layers libraries
Browse files Browse the repository at this point in the history
Fix #10094
  • Loading branch information
hevrard committed Oct 24, 2019
1 parent ab4f976 commit fc10a9d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ private static String createBuildFile(
String ccToolchainSuiteTemplate = getTemplate("android_ndk_cc_toolchain_suite_template.txt");
String ccToolchainTemplate = getTemplate("android_ndk_cc_toolchain_template.txt");
String stlFilegroupTemplate = getTemplate("android_ndk_stl_filegroup_template.txt");
String vulkanValidationLayersTemplate = getTemplate("android_ndk_vulkan_validation_layers_template.txt");
String miscLibrariesTemplate = getTemplate("android_ndk_misc_libraries_template.txt");

StringBuilder ccToolchainSuites = new StringBuilder();
StringBuilder ccToolchainRules = new StringBuilder();
StringBuilder stlFilegroups = new StringBuilder();
StringBuilder vulkanValidationLayersRules = new StringBuilder();
for (CrosstoolStlPair crosstoolStlPair : crosstools) {

// Create the cc_toolchain_suite rule
Expand Down Expand Up @@ -131,6 +133,13 @@ private static String createBuildFile(
.replace("%name%", entry.getKey())
.replace("%fileGlobPattern%", entry.getValue()));
}

// Create the Vulkan validation layers libraries
for (CToolchain toolchain : crosstool.getToolchainList()) {
vulkanValidationLayersRules.append(
vulkanValidationLayersTemplate.replace("%cpu%", toolchain.getTargetCpu()));
}

}

return buildFileTemplate
Expand All @@ -139,6 +148,7 @@ private static String createBuildFile(
.replace("%ccToolchainSuites%", ccToolchainSuites)
.replace("%ccToolchainRules%", ccToolchainRules)
.replace("%stlFilegroups%", stlFilegroups)
.replace("%vulkanValidationLayers%", vulkanValidationLayers)
.replace("%miscLibraries%", miscLibrariesTemplate);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ alias(

%stlFilegroups%

################################################################
# Vulkan validation layers libraries
################################################################

%vulkanValidationLayers%

################################################################
# Miscellaneous runtime libraries
################################################################
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cc_library(
name = "vulkan_validation_layers_%cpu%",
srcs = glob(["ndk/sources/third_party/vulkan/src/build-android/jniLibs/%cpu%/libVkLayer_*.so"]),
)

0 comments on commit fc10a9d

Please sign in to comment.