summaryrefslogtreecommitdiff
path: root/xmake/modules/detect
diff options
context:
space:
mode:
authorruki <[email protected]>2020-06-20 20:29:18 +0800
committerruki <[email protected]>2020-06-20 20:29:18 +0800
commitd3eb3f508142bdd29a243b469116a665cf929f3d (patch)
tree78e5b4efc3cbe37eea75ee8f4ce5e9bd7c9cfed5 /xmake/modules/detect
parenta98aac667515d3fd59056a541199cdfe460f3d89 (diff)
support lib for runenvs
Diffstat (limited to 'xmake/modules/detect')
-rw-r--r--xmake/modules/detect/tools/find_lib.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/xmake/modules/detect/tools/find_lib.lua b/xmake/modules/detect/tools/find_lib.lua
index 2b65c978b..653dca5bb 100644
--- a/xmake/modules/detect/tools/find_lib.lua
+++ b/xmake/modules/detect/tools/find_lib.lua
@@ -21,6 +21,7 @@
-- imports
import("lib.detect.find_program")
import("lib.detect.find_programver")
+import("lib.detect.find_tool")
-- find lib
--
@@ -50,8 +51,10 @@ function main(opt)
io.writefile(sourcefile, "int test(void)\n{return 0;}")
-- check it
- os.runv("cl", {"-c", "-Fo" .. objectfile, sourcefile}, {envs = opt.envs})
- os.runv("link", {"-lib", "-out:" .. libraryfile, objectfile}, {envs = opt.envs})
+ local cl = assert(find_tool("cl"))
+ local link = assert(find_tool("link"))
+ os.runv(cl.program, {"-c", "-Fo" .. objectfile, sourcefile}, {envs = opt.envs})
+ os.runv(link.program, {"-lib", "-out:" .. libraryfile, objectfile}, {envs = opt.envs})
verinfo = os.iorunv(program, {"-list", libraryfile}, {envs = opt.envs})
-- remove files