diff options
| author | ruki <[email protected]> | 2021-05-08 14:34:54 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-05-08 14:34:54 +0800 |
| commit | 76d737fcc850ba14de9ca18cdb49c7bfbf3e6620 (patch) | |
| tree | bd937c13c9ef88ba171bdd3057fe78e2e624eace | |
| parent | ac075b699354bc72af7b6b80f07597860874ffd5 (diff) | |
improve nvcc/has_flags
| -rw-r--r-- | xmake/modules/detect/tools/nvcc/has_flags.lua | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/xmake/modules/detect/tools/nvcc/has_flags.lua b/xmake/modules/detect/tools/nvcc/has_flags.lua index 9a66c5f42..c30c87363 100644 --- a/xmake/modules/detect/tools/nvcc/has_flags.lua +++ b/xmake/modules/detect/tools/nvcc/has_flags.lua @@ -37,10 +37,9 @@ function _islinker(flags, opt) end -- try running -function _try_running(...) - local argv = {...} +function _try_running(program, argv, opt) local errors = nil - return try { function () os.runv(unpack(argv)); return true end, catch { function (errs) errors = (errs or ""):trim() end }}, errors + return try { function () os.runv(program, argv, opt); return true end, catch { function (errs) errors = (errs or ""):trim() end }}, errors end -- attempt to check it from the argument list @@ -124,7 +123,7 @@ function _check_try_running(flags, opt, islinker) end -- check flags - return _try_running(opt.program, table.join(flags, args)) + return _try_running(opt.program, table.join(flags, args), opt) end -- has_flags(flags)? |
