summaryrefslogtreecommitdiff
path: root/xmake/rules
diff options
context:
space:
mode:
authorruki <[email protected]>2020-04-22 22:37:38 +0800
committerruki <[email protected]>2020-04-22 09:45:50 +0800
commit56d0939297f81d8a6790e4b638ff516e4a6c3e08 (patch)
tree33d2901ba9cfe03ad19aae394c511d3d8b6bbb48 /xmake/rules
parent15dc39430ed49d42709bba3ef2acab8500414a3a (diff)
add xmake_cli/hello test
Diffstat (limited to 'xmake/rules')
-rw-r--r--xmake/rules/xmake_cli/xmake.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/xmake/rules/xmake_cli/xmake.lua b/xmake/rules/xmake_cli/xmake.lua
index 25acf0568..415b59015 100644
--- a/xmake/rules/xmake_cli/xmake.lua
+++ b/xmake/rules/xmake_cli/xmake.lua
@@ -22,4 +22,11 @@
rule("xmake.cli")
before_load(function (target)
target:set("kind", "binary")
+ assert(target:pkg("libxmake"), 'please add_packages("libxmake") to target(%s) first!', target:name())
+ end)
+ before_run(function (target)
+ local libxmake = target:pkg("libxmake")
+ local programdir = path.join(path.directory(libxmake:get("linkdirs")), "share", "xmake")
+ assert(os.isdir(programdir), "%s not found!", programdir)
+ os.setenv("XMAKE_PROGRAM_DIR", programdir)
end)