diff options
| author | ruki <[email protected]> | 2022-03-02 23:30:14 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-03-02 23:30:14 +0800 |
| commit | 0a707bfb27db9d87a8063985f4623c0ed4a81a07 (patch) | |
| tree | 4f5fb01baa23543cabc11d061c0e7da5f10f2492 | |
| parent | 2b41664099c802067a86e04d659b7390a4222c95 (diff) | |
improve ld
| -rw-r--r-- | xmake/modules/core/tools/gcc.lua | 4 | ||||
| -rw-r--r-- | xmake/modules/core/tools/ld.lua | 13 |
2 files changed, 5 insertions, 12 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index 812de70aa..a1dc82c9d 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -79,8 +79,8 @@ function nf_strip(self, level, target) debug = "-Wl,-S" , all = "-s" } - if target:is_plat("macosx") or target:is_plat("iphoneos") then - maps.all = "-Wl,-x" + if target:is_plat("macosx", "iphoneos") then + maps.all = "-Wl,-x" end return maps[level] end 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 |
