diff options
| author | ruki <[email protected]> | 2019-05-18 00:38:26 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-05-17 21:50:38 +0800 |
| commit | d0fc956fc21a92a39c7f56d62820ab78946617f0 (patch) | |
| tree | 7e0d5ac4ce2857d8696525e0ea274b6a0f1d4c3c | |
| parent | 9c464b2ebdf56f4da8202b419db18105e86d45e3 (diff) | |
improve nvcc/has_flags
| -rw-r--r-- | xmake/modules/detect/tools/nvcc/has_flags.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/xmake/modules/detect/tools/nvcc/has_flags.lua b/xmake/modules/detect/tools/nvcc/has_flags.lua index 67d2b5a04..7926a15ef 100644 --- a/xmake/modules/detect/tools/nvcc/has_flags.lua +++ b/xmake/modules/detect/tools/nvcc/has_flags.lua @@ -99,7 +99,12 @@ function _check_try_running(flags, opt, islinker) end -- check flags - return _try_running(opt.program, table.join(flags, "-o", os.nuldev(), sourcefile)) + local objectfile = is_plat("windows") and sourcefile .. ".o" or os.nuldev() + if islinker then + return _try_running(opt.program, table.join(flags, "-o", objectfile, sourcefile)) + else + return _try_running(opt.program, table.join(flags, "-c", "-o", objectfile, sourcefile)) + end end -- has_flags(flags)? |
