diff options
Diffstat (limited to 'xmake/rules')
| -rw-r--r-- | xmake/rules/xmake_cli/xmake.lua | 7 |
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) |
