summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/cparser.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2018-11-13 22:48:36 +0800
committerruki <[email protected]>2018-11-13 10:51:40 +0800
commit7d234801498d6e272d780407695ebff89a64d675 (patch)
tree28313737e1c44c3d639fbf49ab05ed0bc68ec1d4 /xmake/modules/core/tools/cparser.lua
parentbcfe7b269dc8ccca180099c8ce62f333a405ed11 (diff)
improve compiler tools
Diffstat (limited to 'xmake/modules/core/tools/cparser.lua')
-rw-r--r--xmake/modules/core/tools/cparser.lua32
1 files changed, 12 insertions, 20 deletions
diff --git a/xmake/modules/core/tools/cparser.lua b/xmake/modules/core/tools/cparser.lua
index c993b8317..ee8864b7f 100644
--- a/xmake/modules/core/tools/cparser.lua
+++ b/xmake/modules/core/tools/cparser.lua
@@ -33,22 +33,21 @@ import("detect.tools.find_ccache")
function init(self)
-- init mxflags
- _g.mxflags = { "-fmessage-length=0"
- , "-pipe"
- , "-fpascal-strings"
- , "-DIBOutlet=__attribute__((iboutlet))"
- , "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))"
- , "-DIBAction=void)__attribute__((ibaction)"}
+ self:set("mxflags", "-fmessage-length=0"
+ , "-pipe"
+ , "-fpascal-strings"
+ , "-DIBOutlet=__attribute__((iboutlet))"
+ , "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))"
+ , "-DIBAction=void)__attribute__((ibaction)")
-- init shflags
- _g.shflags = { "-shared", "-fPIC" }
+ self:set("shflags", "-shared", "-fPIC")
-- init cxflags for the kind: shared
- _g.shared = {}
- _g.shared.cxflags = {"-fPIC"}
+ self:set("shared.cxflags", "-fPIC")
-- init flags map
- _g.mapflags =
+ self:set("mapflags",
{
-- warnings
["-W1"] = "-Wall"
@@ -58,20 +57,13 @@ function init(self)
-- strip
, ["-s"] = "-s"
, ["-S"] = "-S"
- }
+ })
-- init buildmodes
- _g.buildmodes =
+ self:set("buildmodes",
{
["object:sources"] = false
- }
-end
-
--- get the property
-function get(self, name)
-
- -- get it
- return _g[name]
+ })
end
-- make the strip flag