summaryrefslogtreecommitdiff
path: root/core/xpack.lua
diff options
context:
space:
mode:
Diffstat (limited to 'core/xpack.lua')
-rw-r--r--core/xpack.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/core/xpack.lua b/core/xpack.lua
new file mode 100644
index 000000000..6da1680a4
--- /dev/null
+++ b/core/xpack.lua
@@ -0,0 +1,26 @@
+xpack("xmake")
+ set_formats("nsis")
+ set_description("A cross-platform build utility based on Lua. https://xmake.io")
+ set_licensefile("../LICENSE.md")
+ add_targets("demo")
+ set_bindir(".")
+ set_iconfile("src/demo/xmake.ico")
+
+ on_load(function (package)
+ local arch = package:arch()
+ if package:is_plat("windows") then
+ if arch == "x64" then
+ arch = "win64"
+ elseif arch == "x86" then
+ arch = "win32"
+ end
+ end
+ package:set("basename", "xmake-v$(version)." .. arch)
+ end)
+
+ add_nsis_installcmds("Enable Long Path", [[
+ ${If} $NoAdmin == "false"
+ ; Enable long path
+ WriteRegDWORD ${HKLM} "SYSTEM\CurrentControlSet\Control\FileSystem" "LongPathsEnabled" 1
+ ${EndIf}]], {description = "Increases the maximum path length limit, up to 32,767 characters (before 256)."})
+