aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhyber Sen <khyber@google.com>2024-02-14 10:27:07 +0000
committerKhyber Sen <khyber@google.com>2024-02-14 22:50:13 +0000
commiteed28eae387726ef7e77cc0606d693868277f0af (patch)
tree0a4b6eb8dd64d723bf96736384b70c1600014f53
parentaf110228b1c1a5051444b3ffa7bd9ab0f50e2f45 (diff)
downloadcommon-eed28eae387726ef7e77cc0606d693868277f0af.tar.gz
build: add implicit `core` and `compiler_builtins` deps in the `#[no_std]` kernel
Similar to userspace, the `core` and `compiler_builtins` deps are only added when `MODULE_ADD_IMPLICIT_DEPS` is true, which allows us to avoid setting `core` as a dependency when building `core`, for example. Test: build.py Bug: 304850822 Change-Id: I0b613ed3084e2d2372aed2b417d9bb2fdc4d8f9a
-rw-r--r--make/module.mk10
1 files changed, 10 insertions, 0 deletions
diff --git a/make/module.mk b/make/module.mk
index 8451b1e3..f52da73d 100644
--- a/make/module.mk
+++ b/make/module.mk
@@ -234,6 +234,16 @@ endif
# concatenate them to use whichever is set
MODULE_KERNEL_RUST_DEPS := $(MODULE_LIBRARY_DEPS) $(MODULE_LIBRARY_EXPORTED_DEPS) $(MODULE_DEPS)
+ifeq ($(call TOBOOL,$(MODULE_ADD_IMPLICIT_DEPS)),true)
+
+# In userspace, MODULE_ADD_IMPLICIT_DEPS adds std.
+# In the kernel, it adds core and compiler_builtins.
+MODULE_KERNEL_RUST_DEPS += \
+ trusty/user/base/lib/libcore-rust/ \
+ trusty/user/base/lib/libcompiler_builtins-rust/ \
+
+endif
+
define READ_CRATE_INFO
QUERY_MODULE := $1
QUERY_VARIABLES := MODULE_CRATE_NAME MODULE_RUST_STEM MODULE_RUST_CRATE_TYPES