Skip to content

Commit

Permalink
Make AndroidTests pass with incompatible_disallow_empty_glob
Browse files Browse the repository at this point in the history
There are several globs that are empty and this prevents building
with the incompatible flag #8195.
This commit just makes it explicit that empty is allowed.

Closes #15374.

PiperOrigin-RevId: 477730831
Change-Id: I7063906f8eca5db4653fb126f4b781dec2c035cd
  • Loading branch information
limdor authored and copybara-github committed Sep 29, 2022
1 parent fe5bb70 commit 6c78ed8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ toolchain(

filegroup(
name = "%toolchainName%-all_files",
srcs = glob(["ndk/toolchains/%toolchainDirectory%/**"]) + glob([
srcs = glob(["ndk/toolchains/%toolchainDirectory%/**"], allow_empty = True) + glob([
%toolchainFileGlobs%
]) + [
], allow_empty = True) + [
":%dynamicRuntimeLibs%",
":%staticRuntimeLibs%",
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cc_library(
name = "cpufeatures",
srcs = glob(["ndk/sources/android/cpufeatures/*.c"]),
hdrs = glob(["ndk/sources/android/cpufeatures/*.h"]),
srcs = glob(["ndk/sources/android/cpufeatures/*.c"], allow_empty = True),
hdrs = glob(["ndk/sources/android/cpufeatures/*.h"], allow_empty = True),
linkopts = ["-ldl"],
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
filegroup(
name = "%name%",
srcs = glob(["%fileGlobPattern%"]),
srcs = glob(["%fileGlobPattern%"], allow_empty = True),
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cc_library(
name = "vulkan_validation_layers_%toolchainName%",
srcs = glob(["ndk/sources/third_party/vulkan/src/build-android/jniLibs/%cpu%/libVkLayer_*.so"]),
srcs = glob(["ndk/sources/third_party/vulkan/src/build-android/jniLibs/%cpu%/libVkLayer_*.so"], allow_empty = True),
)
4 changes: 2 additions & 2 deletions tools/android/android_sdk_repository_template.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def create_android_sdk_rules(
"build-tools/%s/lib/**" % build_tools_directory,
# Build tools version 24.0.0 added a lib64 folder.
"build-tools/%s/lib64/**" % build_tools_directory,
]),
], allow_empty = True),
)

for tool in ["aapt", "aapt2", "aidl", "zipalign"]:
Expand Down Expand Up @@ -444,7 +444,7 @@ def create_system_images_filegroups(system_image_dirs):
)
native.filegroup(
name = "%s_qemu2_extra" % name,
srcs = native.glob(["%s/kernel-ranchu" % system_image_dir]),
srcs = native.glob(["%s/kernel-ranchu" % system_image_dir], allow_empty = True),
)
else:
# For supported system images that are not installed in the SDK, we
Expand Down

0 comments on commit 6c78ed8

Please sign in to comment.