summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-01-05 22:42:52 +0800
committerGitHub <[email protected]>2022-01-05 22:42:52 +0800
commitc942938c04325e6c49d869fce4d15e69c351f516 (patch)
tree0925e44a1aef62875be1c54cd60d9f8a179c9d17
parent22573fd1defd7b2b9782f12d39b6a86f90588688 (diff)
Update driver_modules.lua
-rw-r--r--xmake/rules/platform/linux/driver/driver_modules.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/xmake/rules/platform/linux/driver/driver_modules.lua b/xmake/rules/platform/linux/driver/driver_modules.lua
index 9a8db4871..4f2640c83 100644
--- a/xmake/rules/platform/linux/driver/driver_modules.lua
+++ b/xmake/rules/platform/linux/driver/driver_modules.lua
@@ -117,6 +117,10 @@ module_exit(hello_exit);
or (cflag:startswith("-W") and not cflag:startswith("-Wp,-MMD,") and not cflag:startswith("-Wp,-MD,"))
or (cflag:startswith("-D") and not cflag:find("KBUILD_MODNAME=") and not cflag:find("KBUILD_BASENAME=")) then
has_cflag = true
+ local macro = cflag:match("%-D\"(.+)\"") -- -D"KBUILD_XXX=xxx"
+ if macro then
+ cflag = "-D" .. macro
+ end
elseif cflag == "-I" or cflag == "-isystem" or cflag == "-include" then
include_cflag = cflag
elseif cflag:startswith("-I") or include_cflag then