summaryrefslogtreecommitdiff
path: root/xmake/rules/platform/linux/driver/driver_modules.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/rules/platform/linux/driver/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