瀏覽代碼

securemsm-kernel: Meet external module dependency with bazel

Make required changes to satisfy external module dependency.
This gives flexibilty for external modules to include
*.h
linux/*.h

Change-Id: I68c5a5842f84622b85da0056f998775f89e6eebf
Smita Ghosh 2 年之前
父節點
當前提交
d45cf2d3bf
共有 3 個文件被更改,包括 7 次插入4 次删除
  1. 3 3
      BUILD.bazel
  2. 1 0
      securemsm_kernel.bzl
  3. 3 1
      securemsm_modules.bzl

+ 3 - 3
BUILD.bazel

@@ -8,13 +8,13 @@ load("//build/kernel/kleaf:kernel.bzl", "ddk_headers")
 
 ddk_headers(
     name = "smcinvoke_kernel_headers",
-    hdrs = [
+    hdrs = glob([
         "include/linux/smcinvoke*.h",
         "include/linux/IClientE*.h",
         "linux/misc/qseecom_kernel.h",
         "linux/misc/qseecom_priv.h"
-    ],
-    includes = ["include/linux", "linux"]
+    ]),
+    includes = ["include/linux", "linux", "include"]
 )
 
 ddk_headers(

+ 1 - 0
securemsm_kernel.bzl

@@ -77,6 +77,7 @@ def define_target_variant_modules(target, variant, modules, extra_options = [],
             srcs = module_srcs,
             out = "{}.ko".format(module["name"]),
             deps = ["//msm-kernel:all_headers"] + [_replace_formatting_codes(target, variant, dep) for dep in module["deps"]],
+            hdrs = module["hdrs"],
             local_defines = target_local_defines,
             copts = module["copts"]
 

+ 3 - 1
securemsm_modules.bzl

@@ -16,7 +16,7 @@ securemsm_modules_by_config = {}
 # default_srcs: A list of sources to be added to the module regardless of configuration options.
 # deps: A list of kernel_module or ddk_module rules that this module depends on.
 
-def register_securemsm_module(name, path = None, config_option = None, default_srcs = [], config_srcs = {}, deps = [], srcs = [], copts = []):
+def register_securemsm_module(name, path = None, config_option = None, default_srcs = [], config_srcs = {}, deps = [], srcs = [], copts = [], hdrs = []):
     processed_config_srcs = {}
 
     for config_src_name in config_srcs:
@@ -36,6 +36,7 @@ def register_securemsm_module(name, path = None, config_option = None, default_s
         "deps": deps,
         "copts": copts,
         "srcs": srcs,
+        "hdrs": hdrs,
     }
 
     securemsm_modules[name] = module
@@ -57,6 +58,7 @@ register_securemsm_module(
 
     ],
     deps = [":smcinvoke_kernel_headers"],
+    hdrs = [":smcinvoke_kernel_headers"],
 )
 
 register_securemsm_module(