summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2018-02-05 22:41:02 +0800
committerruki <[email protected]>2018-02-05 10:06:15 +0800
commitf544576e010e2d37defa0592a7b5b919375bd2c3 (patch)
treee078c08e92fd2255070e072e4c4c2fd9a73bb777
parent3067eb2a3f6b8ebd34d719558a7f0dedc527d3fe (diff)
improve linker error tips
-rw-r--r--CHANGELOG.md8
-rw-r--r--xmake/core/tool/linker.lua5
-rw-r--r--xmake/core/tool/tool.lua2
3 files changed, 13 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 976d92536..1bd8bb46a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,10 @@
## master (unreleased)
+### Bugs fixed
+
+* Fix force to add flags bug
+
## v2.1.9
### New features
@@ -426,6 +430,10 @@
## master (开发中)
+## Bugs修复
+
+* 修复无法通过`add_ldflags("xx", "xx", {force = true})`强制设置多个flags的问题
+
## v2.1.9
### 新特性
diff --git a/xmake/core/tool/linker.lua b/xmake/core/tool/linker.lua
index be137b3fa..f17049838 100644
--- a/xmake/core/tool/linker.lua
+++ b/xmake/core/tool/linker.lua
@@ -115,16 +115,19 @@ function linker.load(targetkind, sourcekinds)
-- select the linker
local linkerinfo = nil
local linkertool = nil
+ local firsterror = nil
for _, _linkerinfo in ipairs(linkerinfos) do
-- load the linker tool from the linker kind
linkertool, errors = tool.load(_linkerinfo.linkerkind)
if linkertool then
linkerinfo = _linkerinfo
break
+ else
+ firsterror = firsterror or errors
end
end
if not linkerinfo then
- return nil, errors
+ return nil, firsterror
end
-- get it directly from cache dirst
diff --git a/xmake/core/tool/tool.lua b/xmake/core/tool/tool.lua
index 295aa8785..87b6b708e 100644
--- a/xmake/core/tool/tool.lua
+++ b/xmake/core/tool/tool.lua
@@ -127,7 +127,7 @@ function tool.load(kind)
-- get name
local name = name_or_errors
if not name then
- return nil, string.format("cannot find tool name for %s", program)
+ return nil, string.format("cannot find known tool script for %s", toolname or program)
end
-- new an instance