summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/tools/swiftc.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/xmake/tools/swiftc.lua b/xmake/tools/swiftc.lua
index 2cfc94cc0..b635db6eb 100644
--- a/xmake/tools/swiftc.lua
+++ b/xmake/tools/swiftc.lua
@@ -56,17 +56,19 @@ function init(shellname)
, ["-fsanitize=address"] = ""
}
- -- init ldflags
- local swift_linkdirs = config.get("__swift_linkdirs")
- if swift_linkdirs then
- _g.ldflags = { "-L" .. swift_linkdirs }
- end
-
end
-- get the property
function get(name)
+ -- init ldflags
+ if not _g.ldflags then
+ local swift_linkdirs = config.get("__swift_linkdirs")
+ if swift_linkdirs then
+ _g.ldflags = { "-L" .. swift_linkdirs }
+ end
+ end
+
-- get it
return _g[name]
end