summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2017-05-22 09:52:18 +0800
committerruki <[email protected]>2017-05-22 09:52:18 +0800
commitb55113cf8ab19fcf5fbc64947b996d270d5730c0 (patch)
tree3f478173fea0efb99b2961d363e6393b4338d755
parent433c76d7735fc8006ab400850e0e08a4e5bffdc0 (diff)
fix link error in debug mode for go tests
-rw-r--r--xmake/core/tool/builder.lua2
-rw-r--r--xmake/tools/go.lua7
2 files changed, 7 insertions, 2 deletions
diff --git a/xmake/core/tool/builder.lua b/xmake/core/tool/builder.lua
index d679cd0ff..43bed8bfa 100644
--- a/xmake/core/tool/builder.lua
+++ b/xmake/core/tool/builder.lua
@@ -261,7 +261,7 @@ function builder:_addflags_from_language(flags, target)
for _, flagvalue in ipairs(table.wrap(getter(flagname))) do
-- map and check flag
- local flag = mapper(flagvalue, target)
+ local flag = mapper(flagvalue, target, self:_targetkind())
if flag and flag ~= "" and (not checkstate or self:check(flag)) then
table.join2(flags, flag)
end
diff --git a/xmake/tools/go.lua b/xmake/tools/go.lua
index 3e7afe80d..472ff84ff 100644
--- a/xmake/tools/go.lua
+++ b/xmake/tools/go.lua
@@ -77,7 +77,12 @@ function nf_optimize(level)
end
-- make the symbol flag
-function nf_symbol(level)
+function nf_symbol(level, target, mapkind)
+
+ -- only for compiler
+ if mapkind ~= "object" then
+ return ""
+ end
-- the maps
local maps =