diff options
| author | ruki <[email protected]> | 2020-06-16 23:12:56 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-06-16 13:17:40 +0800 |
| commit | 973f85fd0f602b868a90725408507bd99ceb210a (patch) | |
| tree | 7171d875de4b962a2a9c68437013f47e53837657 /xmake/modules/core/tools/ar.lua | |
| parent | 0d8d98df820f46e2bcfb187105efbbe464cce056 (diff) | |
improve os.execv to support chdir
Diffstat (limited to 'xmake/modules/core/tools/ar.lua')
| -rw-r--r-- | xmake/modules/core/tools/ar.lua | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/xmake/modules/core/tools/ar.lua b/xmake/modules/core/tools/ar.lua index e034924dc..7cf5a2351 100644 --- a/xmake/modules/core/tools/ar.lua +++ b/xmake/modules/core/tools/ar.lua @@ -83,23 +83,17 @@ function extract(self, libraryfile, objectdir) -- get the absolute path of this library libraryfile = path.absolute(libraryfile) - -- enter the object directory - local oldir = os.cd(objectdir) - -- extract it os.runv(self:program(), {"-x", libraryfile}) -- check repeat object name local repeats = {} - local objectfiles = os.iorunv(self:program(), {"-t", libraryfile}) + local objectfiles = os.iorunv(self:program(), {"-t", libraryfile}, {curdir = objectdir}) for _, objectfile in ipairs(objectfiles:split('\n')) do if repeats[objectfile] then raise("object name(%s) conflicts in library: %s", objectfile, libraryfile) end repeats[objectfile] = true end - - -- leave the object directory - os.cd(oldir) end |
