chore: add default group automatly if needed
the name of the default group is the same with the directory name. Signed-off-by: Caoruihong <crh.cao@huawei.com> Change-Id: I3d889a361534adc44e3b1bedfec13efe8e1babf2
This commit is contained in:
parent
d169cad6b4
commit
6549fd8be6
|
@ -70,10 +70,6 @@ kernel_module(module_name) {
|
|||
public_configs = [ ":public" ]
|
||||
}
|
||||
|
||||
group("arm") {
|
||||
public_deps = [ ":$module_name" ]
|
||||
}
|
||||
|
||||
config("public") {
|
||||
include_dirs = [
|
||||
"include",
|
||||
|
|
|
@ -144,10 +144,6 @@ kernel_module(module_name) {
|
|||
public_configs = [ ":public" ]
|
||||
}
|
||||
|
||||
group("usb") {
|
||||
public_deps = [ ":$module_name" ]
|
||||
}
|
||||
|
||||
config("public") {
|
||||
include_dirs = [ "." ]
|
||||
include_dirs += [ "$LITEOSTHIRDPARTY/FreeBSD/sys/dev/evdev" ]
|
||||
|
|
|
@ -56,7 +56,3 @@ kernel_module(module_name) {
|
|||
config("public") {
|
||||
include_dirs = [ "$LITEOSTHIRDPARTY/zlib" ]
|
||||
}
|
||||
|
||||
group("zlib") {
|
||||
public_deps = [ ":$module_name" ]
|
||||
}
|
||||
|
|
12
liteos.gni
12
liteos.gni
|
@ -34,6 +34,18 @@ LITEOSTHIRDPARTY = "//third_party"
|
|||
HDFTOPDIR = "//drivers/adapter/khdf/liteos"
|
||||
|
||||
template("kernel_module") {
|
||||
current_dir_name = get_path_info(rebase_path("."), "file")
|
||||
if (target_name != current_dir_name) {
|
||||
build_gn = rebase_path("BUILD.gn")
|
||||
cmd = "if grep -q '^\s*group\s*(\s*\"$current_dir_name\"\s*)\s*{\s*\$' $build_gn; then echo true; else echo false; fi"
|
||||
has_current_dir_group = exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value")
|
||||
if (!has_current_dir_group) {
|
||||
module_name = target_name
|
||||
group(current_dir_name) {
|
||||
public_deps = [ ":$module_name" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
if (defined(invoker.module_switch) && !invoker.module_switch) {
|
||||
group(target_name) {
|
||||
not_needed(invoker, "*")
|
||||
|
|
|
@ -57,7 +57,3 @@ config("public") {
|
|||
include_dirs += LWIP_PORTING_INCLUDE_DIRS
|
||||
include_dirs += LWIP_INCLUDE_DIRS
|
||||
}
|
||||
|
||||
group("lwip-2.1") {
|
||||
public_deps = [ ":$module_name" ]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue