diff options
| -rw-r--r-- | CHANGELOG.md | 8 | ||||
| -rw-r--r-- | xmake/core/tool/linker.lua | 5 | ||||
| -rw-r--r-- | xmake/core/tool/tool.lua | 2 |
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 |
