summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-05-20 18:32:09 +0800
committerGitHub <[email protected]>2019-05-20 18:32:09 +0800
commitb1fd47f59027fc780e9ae6ffbc36d289859452cf (patch)
tree408cc9ae5487a45b6b2dad414547097b42017a3f
parente58f040c618c09f1899b86d1ca0af6bc7342bd1f (diff)
parentc2c491ab4bedea3be7b1a6aca8bb4e65a9d763db (diff)
Merge pull request #418 from OpportunityLiu/patch-1
Support cudart flags
-rw-r--r--xmake/modules/detect/tools/nvcc/has_flags.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/xmake/modules/detect/tools/nvcc/has_flags.lua b/xmake/modules/detect/tools/nvcc/has_flags.lua
index 7926a15ef..a60f3b8b3 100644
--- a/xmake/modules/detect/tools/nvcc/has_flags.lua
+++ b/xmake/modules/detect/tools/nvcc/has_flags.lua
@@ -48,11 +48,17 @@ 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}
+ 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}
+ if #flags > 1 and builtin_flags_pair[flags[1]] and builtin_flags_pair[flags[1]][flags[2]] then
+ return true
+ end
+
-- check from the `--help` menu, only for linker
if islinker or #flags > 1 then
return