summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-04-20 22:25:24 +0800
committerruki <[email protected]>2019-04-20 22:25:24 +0800
commit36b8963329d23282a8022fc4c117909c3754f40e (patch)
tree9f5c789c12a077e2b4d5a74216881a5c7150a68e
parent53a6bfa3b62a9ed099643a1a5b0a4bb24bc22804 (diff)
fix has_flags for mmd
-rw-r--r--xmake/modules/core/tools/gcc.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index d648c6018..9253bf75c 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -453,13 +453,13 @@ function _compile1(self, sourcefile, objectfile, dependinfo, flags)
function ()
-- support `-MMD -MF depfile.d`? some old gcc does not support it at same time
- if _g._HAS_MMD_MF == nil then
- _g._HAS_MMD_MF = self:has_flags({"-MMD", "-MF", depfile}, "cxflags")
+ if depfile and _g._HAS_MMD_MF == nil then
+ _g._HAS_MMD_MF = self:has_flags({"-MMD", "-MF", os.nuldev()}, "cxflags") or false
end
-- generate includes file
local compflags = flags
- if dependinfo and _g._HAS_MMD_MF then
+ if depfile and _g._HAS_MMD_MF then
compflags = table.join(flags, "-MMD", "-MF", depfile)
end