summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2018-04-09 23:47:05 +0800
committerruki <[email protected]>2018-04-09 16:42:31 +0800
commitfe78a523930b02f1e75c4490cdbae045d43d4f1a (patch)
treea6db244e93c7447a8ae44b50f00c7950c6d9e1dc
parent05c127910b63882369acb354e7c4ca630fb4aca9 (diff)
improve warning flags for swiftc
-rw-r--r--CHANGELOG.md2
-rw-r--r--xmake/modules/core/tools/swiftc.lua16
2 files changed, 11 insertions, 7 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2aebef299..c5481e2f6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@
* Add FAQ to the auto-generated xmake.lua
* Support android NDK >= r14
+* Improve warning flags for swiftc
### Bugs fixed
@@ -451,6 +452,7 @@
* 添加FAQ到自动生成的xmake.lua文件,方便用户快速上手
* 支持Android NDK >= r14的版本
+* 改进swiftc对warning flags的支持
### Bugs修复
diff --git a/xmake/modules/core/tools/swiftc.lua b/xmake/modules/core/tools/swiftc.lua
index 0be1cc4fd..d8b1e333c 100644
--- a/xmake/modules/core/tools/swiftc.lua
+++ b/xmake/modules/core/tools/swiftc.lua
@@ -36,8 +36,10 @@ function init(self)
["-fvisibility=hidden"] = ""
-- warnings
- , ["-w"] = ""
- , ["-W.*"] = ""
+ , ["-w"] = "-suppress-warnings"
+ , ["-W%d*"] = "-warn-swift3-objc-inference-minimal"
+ , ["-Wall"] = "-warn-swift3-objc-inference-complete"
+ , ["-Werror"] = "-warnings-as-errors"
-- optimize
, ["-O0"] = "-Onone"
@@ -101,11 +103,11 @@ function nf_warning(self, level)
-- the maps
local maps =
{
- none = "-w"
- , less = "-W1"
- , more = "-W3"
- , all = "-Wall"
- , error = "-Werror"
+ none = "-suppress-warnings"
+ , less = "-warn-swift3-objc-inference-minimal"
+ , more = "-warn-swift3-objc-inference-minimal"
+ , all = "-warn-swift3-objc-inference-complete"
+ , error = "-warnings-as-errors"
}
-- make it