summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-03-13 23:21:31 +0800
committerruki <[email protected]>2019-03-13 14:09:08 +0800
commit57506c7b8ba8941ebac3676a241f8444e0079a56 (patch)
treed96c4a685b939831745e4b66edf4b3884aa8666e
parent8dfe470e645f24399234af603187dbd30c39b558 (diff)
fix defines for cuda
-rw-r--r--xmake/languages/cuda/xmake.lua8
-rw-r--r--xmake/modules/core/tools/nvcc.lua20
2 files changed, 28 insertions, 0 deletions
diff --git a/xmake/languages/cuda/xmake.lua b/xmake/languages/cuda/xmake.lua
index d83ee11ed..7651a4d56 100644
--- a/xmake/languages/cuda/xmake.lua
+++ b/xmake/languages/cuda/xmake.lua
@@ -60,12 +60,20 @@ language("cuda")
, "target.optimize:check"
, "target.vectorexts:check"
, "target.includedirs"
+ , "target.languages"
+ , "target.defines"
+ , "target.undefines"
, "option.symbols"
, "option.warnings"
, "option.optimize:check"
, "option.vectorexts:check"
, "option.includedirs"
+ , "option.languages"
+ , "option.defines"
+ , "option.undefines"
, "platform.includedirs"
+ , "platform.defines"
+ , "platform.undefines"
}
, binary =
{
diff --git a/xmake/modules/core/tools/nvcc.lua b/xmake/modules/core/tools/nvcc.lua
index 219619d6d..0c64e1b43 100644
--- a/xmake/modules/core/tools/nvcc.lua
+++ b/xmake/modules/core/tools/nvcc.lua
@@ -102,6 +102,26 @@ function nf_optimize(self, level)
return maps[level]
end
+-- make the language flag
+function nf_language(self, stdname)
+
+ -- the stdc++ maps
+ if _g.cxxmaps == nil then
+ _g.cxxmaps =
+ {
+ cxx03 = "--std c++03"
+ , cxx11 = "--std c++11"
+ , cxx14 = "--std c++14"
+ }
+ local cxxmaps2 = {}
+ for k, v in pairs(_g.cxxmaps) do
+ cxxmaps2[k:gsub("xx", "++")] = v
+ end
+ table.join2(_g.cxxmaps, cxxmaps2)
+ end
+ return _g.cxxmaps[stdname]
+end
+
-- make the define flag
function nf_define(self, macro)
return "-D" .. macro