summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/detect/tools/cl/features.lua7
-rw-r--r--xmake/modules/lib/detect/features.lua2
2 files changed, 4 insertions, 5 deletions
diff --git a/xmake/modules/detect/tools/cl/features.lua b/xmake/modules/detect/tools/cl/features.lua
index 976085659..fb4c98cca 100644
--- a/xmake/modules/detect/tools/cl/features.lua
+++ b/xmake/modules/detect/tools/cl/features.lua
@@ -36,8 +36,8 @@ function _get_macro_defines(snippets, extension, opt)
local defines = try
{
function ()
- os.runv(opt.program, table.join(opt.flags or {}, {"-nologo", "-Fo" .. objectfile, sourcefile, "-link", "-out:" .. binaryfile}))
- return os.iorunv(binaryfile)
+ os.runv(opt.program, table.join(opt.flags or {}, {"-nologo", "-Fo" .. objectfile, sourcefile, "-link", "-out:" .. binaryfile}), {envs = opt.envs})
+ return os.iorunv(binaryfile, {}, {envs = opt.envs})
end
}
if defines then
@@ -50,8 +50,6 @@ function _get_macro_defines(snippets, extension, opt)
os.tryrm(sourcefile)
os.tryrm(objectfile)
os.tryrm(binaryfile)
-
- -- ok?
return results
end
@@ -97,6 +95,7 @@ end
function check_features(opt)
-- check features with all extensions
+ opt = opt or {}
local results = {}
for extension, features in pairs(_g.features) do
diff --git a/xmake/modules/lib/detect/features.lua b/xmake/modules/lib/detect/features.lua
index 048ee85a6..9146e5da6 100644
--- a/xmake/modules/lib/detect/features.lua
+++ b/xmake/modules/lib/detect/features.lua
@@ -32,7 +32,7 @@ import("core.base.scheduler")
-- @code
-- local features = features("clang")
-- local features = features("clang", {flags = "-O0", program = "xcrun -sdk macosx clang"})
--- local features = features("clang", {flags = {"-g", "-O0"}})
+-- local features = features("clang", {flags = {"-g", "-O0"}, envs = {PATH = ""}})
-- @endcode
--
function main(name, opt)