summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/link.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/link.lua
parentbcfe7b269dc8ccca180099c8ce62f333a405ed11 (diff)
improve compiler tools
Diffstat (limited to 'xmake/modules/core/tools/link.lua')
-rw-r--r--xmake/modules/core/tools/link.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/xmake/modules/core/tools/link.lua b/xmake/modules/core/tools/link.lua
index baf300ff2..6a73844ab 100644
--- a/xmake/modules/core/tools/link.lua
+++ b/xmake/modules/core/tools/link.lua
@@ -29,16 +29,16 @@ import("core.project.config")
function init(self)
-- init ldflags
- _g.ldflags = { "-nologo", "-dynamicbase", "-nxcompat"}
+ self:set("ldflags", "-nologo", "-dynamicbase", "-nxcompat")
-- init arflags
- _g.arflags = {"-nologo"}
+ self:set("arflags", "-nologo")
-- init shflags
- _g.shflags = {"-nologo"}
+ self:set("shflags", "-nologo")
-- init flags map
- _g.mapflags =
+ self:set("mapflags",
{
-- strip
["-s"] = ""
@@ -47,12 +47,12 @@ function init(self)
-- others
, ["-ftrapv"] = ""
, ["-fsanitize=address"] = ""
- }
+ })
end
-- get the property
function get(self, name)
- local values = _g[name]
+ local values = self._INFO[name]
if name == "ldflags" or name == "arflags" or name == "shflags" then
-- switch architecture, @note does cache it in init() for generating vs201x project
values = table.join(values, "-machine:" .. (config.arch() or "x86"))