summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/ld.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-03-02 23:30:14 +0800
committerruki <[email protected]>2022-03-02 23:30:14 +0800
commit0a707bfb27db9d87a8063985f4623c0ed4a81a07 (patch)
tree4f5fb01baa23543cabc11d061c0e7da5f10f2492 /xmake/modules/core/tools/ld.lua
parent2b41664099c802067a86e04d659b7390a4222c95 (diff)
improve ld
Diffstat (limited to 'xmake/modules/core/tools/ld.lua')
-rw-r--r--xmake/modules/core/tools/ld.lua13
1 files changed, 3 insertions, 10 deletions
diff --git a/xmake/modules/core/tools/ld.lua b/xmake/modules/core/tools/ld.lua
index 0eaa8fc91..2b91c2634 100644
--- a/xmake/modules/core/tools/ld.lua
+++ b/xmake/modules/core/tools/ld.lua
@@ -38,15 +38,12 @@ function init(self)
end
-- make the strip flag
-function nf_strip(self, level)
- local maps =
- {
+function nf_strip(self, level, target)
+ local maps = {
debug = "-S"
, all = "-s"
}
-
- local plat = config.plat()
- if plat == "macosx" or plat == "iphoneos" then
+ if target:is_plat("macosx", "iphoneos") then
maps.all = "-Wl,-x"
maps.debug = "-Wl,-S"
end
@@ -80,11 +77,7 @@ end
-- link the target file
function link(self, objectfiles, targetkind, targetfile, flags)
-
- -- ensure the target directory
os.mkdir(path.directory(targetfile))
-
- -- link it
os.runv(linkargv(self, objectfiles, targetkind, targetfile, flags))
end