diff options
| author | OpportunityLiu <[email protected]> | 2020-08-08 18:56:23 +0800 |
|---|---|---|
| committer | OpportunityLiu <[email protected]> | 2020-08-08 18:56:23 +0800 |
| commit | cf488b53e48788b735a4da614e951bd424c677fc (patch) | |
| tree | 74f6e55a481fb271a17da58703e5fd6383eb90f4 | |
| parent | 47755e46178eadda96613d2095d1d551c6033753 (diff) | |
check flags
| -rw-r--r-- | xmake/modules/detect/tools/nvcc/has_flags.lua | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/xmake/modules/detect/tools/nvcc/has_flags.lua b/xmake/modules/detect/tools/nvcc/has_flags.lua index 8cbffc010..0ab430b20 100644 --- a/xmake/modules/detect/tools/nvcc/has_flags.lua +++ b/xmake/modules/detect/tools/nvcc/has_flags.lua @@ -112,12 +112,19 @@ function _check_try_running(flags, opt, islinker) io.writefile(sourcefile, "int main(int argc, char** argv)\n{return 0;}") end - -- check flags - if islinker then - return _try_running(opt.program, table.join(flags, "-o", os.nuldev(), sourcefile)) - else - return _try_running(opt.program, table.join(flags, "-c", "-o", os.nuldev(), sourcefile)) + local args = table.join(flags, "-o", os.nuldev(), sourcefile) + + if not islinker then + table.insert(args, 2, "-c") + end + + local allow_unsupported_compiler = main("-allow-unsupported-compiler", opt) + if allow_unsupported_compiler then + table.insert(args, 1, "-allow-unsupported-compiler") end + + -- check flags + return _try_running(opt.program, args) end -- has_flags(flags)? |
