-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Felix Hilgers
committed
May 27, 2024
1 parent
c4cc011
commit c55e566
Showing
8 changed files
with
58 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
diff --git rules.bzl rules.bzl | ||
index e310c2a..9a6ad51 100644 | ||
--- rules.bzl | ||
+++ rules.bzl | ||
@@ -25,8 +25,9 @@ def _android_ndk_repository_impl(ctx): | ||
""" | ||
ndk_path = ctx.attr.path or ctx.os.environ.get("ANDROID_NDK_HOME", None) | ||
if not ndk_path: | ||
- fail("Either the ANDROID_NDK_HOME environment variable or the " + | ||
- "path attribute of android_ndk_repository must be set.") | ||
+ # Create an empty repository that allows non-Android code to build. | ||
+ ctx.template("BUILD.bazel", ctx.attr._template_empty) | ||
+ return None | ||
|
||
if ctx.os.name == "linux": | ||
clang_directory = "toolchains/llvm/prebuilt/linux-x86_64" | ||
@@ -121,6 +122,7 @@ android_ndk_repository = repository_rule( | ||
"_template_target_systems": attr.label(default = ":target_systems.bzl.tpl", allow_single_file = True), | ||
"_template_ndk_clang": attr.label(default = ":BUILD.ndk_clang.tpl", allow_single_file = True), | ||
"_template_ndk_sysroot": attr.label(default = ":BUILD.ndk_sysroot.tpl", allow_single_file = True), | ||
+ "_template_empty": attr.label(default = ":BUILD.empty.tpl", allow_single_file = True), | ||
}, | ||
local = True, | ||
implementation = _android_ndk_repository_impl, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters