summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2019-05-21 00:40:44 +0800
committerruki <[email protected]>2019-05-20 22:04:24 +0800
commitdfa26e72bc4d830c0ace72bdfba51142f1348bef (patch)
treef82fbaa5685898c6d2520c9ec14815783c4063c6 /xmake/modules
parentb1fd47f59027fc780e9ae6ffbc36d289859452cf (diff)
format codes
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/detect/tools/nvcc/has_flags.lua16
1 files changed, 12 insertions, 4 deletions
diff --git a/xmake/modules/detect/tools/nvcc/has_flags.lua b/xmake/modules/detect/tools/nvcc/has_flags.lua
index a60f3b8b3..a6f073a32 100644
--- a/xmake/modules/detect/tools/nvcc/has_flags.lua
+++ b/xmake/modules/detect/tools/nvcc/has_flags.lua
@@ -38,7 +38,6 @@ end
-- try running
function _try_running(...)
-
local argv = {...}
local errors = nil
return try { function () os.runv(unpack(argv)); return true end, catch { function (errs) errors = (errs or ""):trim() end }}, errors
@@ -48,13 +47,22 @@ end
function _check_from_arglist(flags, opt, islinker)
-- check for the builtin flags
- local builtin_flags = {["-code"] = true, ["--gpu-code"] = true, ["-gencode"] = true, ["--generate-code"] = true, ["-arch"] = true, ["--gpu-architecture"] = true, ["-cudart=none"] = true, ["--cudart=none"] = true}
+ local builtin_flags = {["-code"] = true,
+ ["--gpu-code"] = true,
+ ["-gencode"] = true,
+ ["--generate-code"] = true,
+ ["-arch"] = true,
+ ["--gpu-architecture"] = true,
+ ["-cudart=none"] = true,
+ ["--cudart=none"] = true}
if builtin_flags[flags[1]] then
return true
end
- local cudart_flags = {["none"] = true, ["shared"] = true, ["static"] = true}
- local builtin_flags_pair = {["-cudart"] = cudart_flags, ["--cudart"] = cudart_flags}
+ -- check for the builtin flag=value
+ local cudart_flags = {none = true, shared = true, static = true}
+ local builtin_flags_pair = {["-cudart"] = cudart_flags,
+ ["--cudart"] = cudart_flags}
if #flags > 1 and builtin_flags_pair[flags[1]] and builtin_flags_pair[flags[1]][flags[2]] then
return true
end