diff options
| author | wangzhankun <[email protected]> | 2023-01-13 19:24:49 +0800 |
|---|---|---|
| committer | wangzhankun <[email protected]> | 2023-01-13 19:24:49 +0800 |
| commit | a59128b3bc53a0b1305ca9454bcf9e389e92f5f2 (patch) | |
| tree | 91ee444a3ad7fdf7dce860e12ef54e2f901c4cba /xmake/rules/platform/linux/driver/driver_modules.lua | |
| parent | e17a9bd1edcf15b8c7b611f57f639b59a680b810 (diff) | |
fig bug 3279
Diffstat (limited to 'xmake/rules/platform/linux/driver/driver_modules.lua')
| -rw-r--r-- | xmake/rules/platform/linux/driver/driver_modules.lua | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/xmake/rules/platform/linux/driver/driver_modules.lua b/xmake/rules/platform/linux/driver/driver_modules.lua index 9e5b7f1a5..e5541cb2f 100644 --- a/xmake/rules/platform/linux/driver/driver_modules.lua +++ b/xmake/rules/platform/linux/driver/driver_modules.lua @@ -115,9 +115,17 @@ module_exit(hello_exit); local include_cflag = false for _, cflag in ipairs(line:split("%s+")) do local has_cflag = false - if cflag:startswith("-f") or cflag:startswith("-m") - 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 + if cflag:startswith("-fplugin=") then + -- @see https://github.com/xmake-io/xmake/issues/3279 + local plugindir = cflag:sub(10) + if not path.is_absolute(plugindir) then + plugindir = path.absolute(plugindir, sdkdir) + end + cflag = "-fplugin=" .. plugindir + has_cflag = true + elseif cflag:startswith("-f") or cflag:startswith("-m") + 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 @@ -140,14 +148,6 @@ module_exit(hello_exit); end has_cflag = true include_cflag = nil - elseif cflag:startswith("-fplugin=") then - -- @see https://github.com/xmake-io/xmake/issues/3279 - local plugindir = cflag:sub(10) - if not path.is_absolute(plugindir) then - plugindir = path.absolute(plugindir, sdkdir) - end - cflag = "-fplugin=" .. plugindir - has_cflag = true end if has_cflag then cflags = cflags or {} |
