Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Android NDK Vulkan validation layers libraries #10095

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 vulkanValidationLayers = new StringBuilder();
for (CrosstoolStlPair crosstoolStlPair : crosstools) {

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

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

}

return buildFileTemplate
Expand All @@ -139,6 +150,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_%toolchainName%",
srcs = glob(["ndk/sources/third_party/vulkan/src/build-android/jniLibs/%cpu%/libVkLayer_*.so"]),
)