summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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