summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/swiftc.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2023-07-10 23:05:50 +0800
committerruki <[email protected]>2023-07-10 23:05:50 +0800
commita4b10bb067a5f13708f5ceec469ab862e5f8ea7f (patch)
treebc3c8f0e62fa733a24175c3aeebff3b9941ad7f1 /xmake/modules/core/tools/swiftc.lua
parent7bd90133902bc03bbc6b10f20a6aa7149f626caa (diff)
add swift-frontend tool
Diffstat (limited to 'xmake/modules/core/tools/swiftc.lua')
-rw-r--r--xmake/modules/core/tools/swiftc.lua32
1 files changed, 6 insertions, 26 deletions
diff --git a/xmake/modules/core/tools/swiftc.lua b/xmake/modules/core/tools/swiftc.lua
index 948e408ab..888cbb2e0 100644
--- a/xmake/modules/core/tools/swiftc.lua
+++ b/xmake/modules/core/tools/swiftc.lua
@@ -26,8 +26,8 @@ import("core.language.language")
function init(self)
-- init flags map
- self:set("mapflags",
- {
+ self:set("mapflags", {
+
-- symbols
["-fvisibility=hidden"] = ""
@@ -59,37 +59,24 @@ end
-- make the strip flag
function nf_strip(self, level)
-
- -- the maps
- local maps =
- {
+ local maps = {
debug = "-Xlinker -S"
, all = "-Xlinker -s"
}
-
- -- make it
return maps[level]
end
-- make the symbol flag
function nf_symbol(self, level)
-
- -- the maps
- local maps =
- {
+ local maps = {
debug = "-g"
}
-
- -- make it
return maps[level]
end
-- make the warning flag
function nf_warning(self, level)
-
- -- the maps
- local maps =
- {
+ local maps = {
none = "-suppress-warnings"
, less = "-warn-swift3-objc-inference-minimal"
, more = "-warn-swift3-objc-inference-minimal"
@@ -97,8 +84,6 @@ function nf_warning(self, level)
, everything = "-warn-swift3-objc-inference-complete"
, error = "-warnings-as-errors"
}
-
- -- make it
return maps[level]
end
@@ -122,10 +107,7 @@ end
-- make the vector extension flag
function nf_vectorext(self, extension)
-
- -- the maps
- local maps =
- {
+ local maps = {
mmx = "-mmmx"
, sse = "-msse"
, sse2 = "-msse2"
@@ -135,8 +117,6 @@ function nf_vectorext(self, extension)
, avx2 = "-mavx2"
, neon = "-mfpu=neon"
}
-
- -- make it
return maps[extension]
end