Skip to content

Commit

Permalink
Use //conditions:default for config flags in linux (#18)
Browse files Browse the repository at this point in the history
* Set //conditions:default as conditions for building in Linux.

* Increased version number.
  • Loading branch information
jadarve authored Jul 27, 2023
1 parent cdce927 commit a70c75d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 22 deletions.
24 changes: 6 additions & 18 deletions BUILD
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@

# See https://github.com/bazelbuild/bazel/blob/master/src/conditions/BUILD for standard conditions.
# Unfortunately, there is no one for android at the moment.
# Linux is the default platform.

config_setting (
name = "linux",
constraint_values = [
"@platforms//os:linux",
],
visibility = ["//visibility:public"]
)

config_setting (
config_setting(
name = "android",
# constraint_values = [
# # Does not work with mediapipe
# "@platforms//os:android",
# ],
values = {
# same as that of mediapipe
"crosstool_top": "//external:android/crosstool"
"crosstool_top": "//external:android/crosstool",
},
visibility = ["//visibility:public"]
visibility = ["//visibility:public"],
)

config_setting(
Expand All @@ -38,7 +26,7 @@ config_setting(
filegroup(
name = "readme_file",
srcs = [
"README.md"
"README.md",
],
visibility = ["//visibility:public"]
visibility = ["//visibility:public"],
)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
git_repository(
name = "rules_vulkan",
remote = "https://github.com/jadarve/rules_vulkan.git",
tag = "v0.0.10"
tag = "v0.0.11"
)

load("@rules_vulkan//vulkan:repositories.bzl", "vulkan_repositories")
Expand Down
5 changes: 2 additions & 3 deletions vulkan/BUILD
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
load("@rules_cc//cc:defs.bzl", "cc_library")

VULKAN_LINKOPTS = select({
"@rules_vulkan//:linux": ["-lvulkan"],
"@rules_vulkan//:android": [],
"@rules_vulkan//:windows": [],
"@rules_vulkan//:darwin": [],
"//conditions:default": [],
"//conditions:default": ["-lvulkan"],
})

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": ["@vulkan_linux//:vulkan_cc_library"],
},
no_match_error = "No configuration matches the supported platforms",
)
Expand Down

0 comments on commit a70c75d

Please sign in to comment.