summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/gcc.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2018-12-20 23:55:49 +0800
committerruki <[email protected]>2018-12-20 17:34:56 +0800
commitd95758dc85e1e34e6ce507ffee78f7634a0661c5 (patch)
treef740966dedf5eea54bf54c4f7d379fcfa012034a /xmake/modules/core/tools/gcc.lua
parentcbce3651b8baff9d4cad89b3056e629c9ace4a41 (diff)
add flagkind to has_flags
Diffstat (limited to 'xmake/modules/core/tools/gcc.lua')
-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 278df4451..89773c85c 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -254,12 +254,12 @@ end
-- make the rpathdir flag
function nf_rpathdir(self, dir)
- if self:has_flags("-Wl,-rpath=" .. dir) then
+ if self:has_flags("-Wl,-rpath=" .. dir, "ldflags") then
return "-Wl,-rpath=" .. os.args(dir:gsub("@[%w_]+", function (name)
local maps = {["@loader_path"] = "$ORIGIN", ["@executable_path"] = "$ORIGIN"}
return maps[name]
end))
- elseif self:has_flags("-Xlinker -rpath -Xlinker " .. dir) then
+ elseif self:has_flags("-Xlinker -rpath -Xlinker " .. dir, "ldflags") then
return "-Xlinker -rpath -Xlinker " .. os.args(dir:gsub("%$ORIGIN", "@loader_path"))
end
end
@@ -330,7 +330,7 @@ function _include_deps(self, sourcefile, flags)
-- support -E -MM? some old gcc does not support it at same time
if _g._HAS_EMM == nil then
- _g._HAS_EMM = self:has_flags("-E -MM")
+ _g._HAS_EMM = self:has_flags("-E -MM", "cxflags")
end
if not _g._HAS_EMM then
return {}