Skip to content

Commit

Permalink
Fix build for linux and android. (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
jadarve authored Oct 20, 2022
1 parent e2f4a8c commit 5843b89
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
9 changes: 6 additions & 3 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@
config_setting (
name = "linux",
constraint_values = [
"@platforms//os:linux"
"@platforms//os:linux",
],
visibility = ["//visibility:public"]
)

config_setting (
name = "android",
# constraint_values = [
# # Does not work with mediapipe
# "@platforms//os:android",
# ],
values = {
# at least this works for building mediapipe AAR
"host_crosstool_top": "@bazel_tools//tools/cpp:toolchain",
"define": "RULES_VULKAN_ANDROID=1"
},
visibility = ["//visibility:public"]
)
Expand Down
7 changes: 5 additions & 2 deletions vulkan/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ VULKAN_LINKOPTS = select({

"@rules_vulkan//:linux": ["-lvulkan"],
"@rules_vulkan//:android": [],
"@rules_vulkan//:windows": [],
"@rules_vulkan//:darwin": [],
"//conditions:default": [],
})

VULKAN_LIBRARIES = select({
"@rules_vulkan//:windows": ["@vulkan_windows//:vulkan_cc_library"],
"@rules_vulkan//:darwin": ["@vulkan_macos//:vulkan_cc_library"],
"@rules_vulkan//:linux": ["@vulkan_linux//:vulkan_cc_library"],
"@rules_vulkan//:android": ["@vulkan_android//:vulkan_cc_library"],
"//conditions:default": [],
})
},
no_match_error = "No configuration matches the supported platforms")

cc_library(
name = "vulkan_cc_library",
Expand Down
2 changes: 0 additions & 2 deletions vulkan/platform/android.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ def _impl(repository_ctx):
ndk_home = repository_ctx.os.environ.get('ANDROID_NDK_HOME', None)
if ndk_home == None:
fail('ANDROID_NDK_HOME environment variable not found')

print("MONI: " + ndk_home + "/sources/third_party/vulkan/src/include")

repository_ctx.symlink(ndk_home, "vulkan_sdk_android")

Expand Down

0 comments on commit 5843b89

Please sign in to comment.