summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-09-01 13:30:54 +0800
committerruki <[email protected]>2019-09-01 13:30:54 +0800
commitc389da17f9d6bbe99ea10ef3a997a57967e3bffc (patch)
tree14a6ddadb49ae19d313e51efc705824b02c88bdc
parent49668a1b7eed1a35d0114ce4ee78c88887a064c8 (diff)
add cuda build rules
-rw-r--r--.travis.yml1
-rw-r--r--xmake/rules/cuda/devlink/xmake.lua4
-rw-r--r--xmake/rules/cuda/xmake.lua12
3 files changed, 11 insertions, 6 deletions
diff --git a/.travis.yml b/.travis.yml
index 25291faa0..34afdb3f6 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -34,6 +34,5 @@ script:
- travis_wait 60 xmake lua -v -D tests/run.lua
- scripts/archive-all.sh
- scripts/makeself/build-runfile.sh
- - ls -l scripts/makeself/xmake.gz.run
- scripts/makeself/xmake.gz.run --info
diff --git a/xmake/rules/cuda/devlink/xmake.lua b/xmake/rules/cuda/devlink/xmake.lua
index 83a719381..90c796370 100644
--- a/xmake/rules/cuda/devlink/xmake.lua
+++ b/xmake/rules/cuda/devlink/xmake.lua
@@ -19,7 +19,7 @@
--
-- define rule: device-link
-rule("cuda.devlink")
+rule("cuda.build.devlink")
-- add rule: cuda environment
add_deps("cuda.env")
@@ -36,7 +36,7 @@ rule("cuda.devlink")
import("core.platform.platform")
-- disable devlink?
- if target:values("cuda.devlink") == false then
+ if target:values("cuda.build.devlink") == false then
return
end
diff --git a/xmake/rules/cuda/xmake.lua b/xmake/rules/cuda/xmake.lua
index 09e4c3fbe..d3e137254 100644
--- a/xmake/rules/cuda/xmake.lua
+++ b/xmake/rules/cuda/xmake.lua
@@ -18,9 +18,15 @@
-- @file xmake.lua
--
+-- define rule: cuda.build
+rule("cuda.build")
+ set_extensions(".cu")
+ add_deps("cuda.build.devlink")
+ on_build_files(function (target, sourcebatch, opt)
+ import("private.action.build.object")(target, sourcebatch, opt)
+ end)
+
-- define rule: cuda
rule("cuda")
-
- -- add rules
- add_deps("cuda.devlink", "cuda.gencodes")
+ add_deps("cuda.build", "cuda.gencodes")