summaryrefslogtreecommitdiff
path: root/xmake/core/tool/compiler.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-07-10 21:34:02 +0800
committerruki <[email protected]>2017-07-10 21:34:02 +0800
commit03420ca44581f299a48935ca60af4824575cd9c1 (patch)
treeb4644e07c92e62b973d15f3f0d3e0ee41f95446e /xmake/core/tool/compiler.lua
parentdef23a930fc3780e54b2a8a6fc60854d2e193000 (diff)
add has_features and features for compiler
Diffstat (limited to 'xmake/core/tool/compiler.lua')
-rw-r--r--xmake/core/tool/compiler.lua12
1 files changed, 9 insertions, 3 deletions
diff --git a/xmake/core/tool/compiler.lua b/xmake/core/tool/compiler.lua
index 622ed946b..b3f58c512 100644
--- a/xmake/core/tool/compiler.lua
+++ b/xmake/core/tool/compiler.lua
@@ -184,6 +184,12 @@ function compiler:compcmd(sourcefiles, objectfile, opt)
end
-- get the compling flags
+--
+-- @param opt the argument options (contain all the compiler attributes of target),
+-- .e.g {target = ..., targetkind = "static", cxflags = "", defines = "", includedirs = "", ...}
+--
+-- @return flags string, flags list
+--
function compiler:compflags(opt)
-- init options
@@ -192,10 +198,10 @@ function compiler:compflags(opt)
-- get target
local target = opt.target
- -- get the target key
+ -- make the key
local key = nil
- if target then
- key = tostring(target)
+ for _, arg in pairs(opt) do
+ key = (key or "") .. tostring(arg)
end
-- get it directly from cache dirst