diff options
| author | ruki <[email protected]> | 2015-12-06 00:38:11 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-12-06 00:38:11 +0800 |
| commit | b7a0ed4cd24fbd421715dad7376ae691871ca126 (patch) | |
| tree | ade15aaefe06cdfad6ee4fb81289c0b0e21f278d /xmake/scripts/platform/windows/tools/lib.lua | |
| parent | 55baf72274c1aeefceb125f49a4da77e1d49bf40 (diff) | |
auto configure if makefile not exists
Diffstat (limited to 'xmake/scripts/platform/windows/tools/lib.lua')
| -rw-r--r-- | xmake/scripts/platform/windows/tools/lib.lua | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/xmake/scripts/platform/windows/tools/lib.lua b/xmake/scripts/platform/windows/tools/lib.lua index 8fcd682e5..e56e4c195 100644 --- a/xmake/scripts/platform/windows/tools/lib.lua +++ b/xmake/scripts/platform/windows/tools/lib.lua @@ -25,6 +25,7 @@ local lib = lib or {} -- load modules local io = require("base/io") +local os = require("base/os") local path = require("base/path") local utils = require("base/utils") local string = require("base/string") @@ -77,11 +78,23 @@ function lib.extract(self, ...) -- extrace all object files for line in file:lines() do + print(line) -- is object file? if line:find("%.obj") then -- init command - local cmd = string.format("%s -nologo -extract:%s -out:%s\\%s %s", self.name, line, objdir, path.filename(line), libfile) + local out = path.translate(string.format("%s\\%s", objdir, path.filename(line))) + + -- repeat? rename it + if os.isfile(out) then + for i = 0, 10 do + out = path.translate(string.format("%s\\%d_%s", objdir, i, path.filename(line))) + if not os.isfile(out) then break end + end + end + + -- init command + local cmd = string.format("%s -nologo -extract:%s -out:%s %s", self.name, line, out, libfile) -- extract it if 0 ~= os.execute(cmd) then |
