summaryrefslogtreecommitdiff
path: root/core/xpack.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2023-11-16 23:05:56 +0800
committerruki <[email protected]>2023-11-16 23:05:56 +0800
commit41de52de7a82e4ed8ef7e0b86ebed344e69820ea (patch)
treeefc47095943cb54e64289d565a2243ea920e1272 /core/xpack.lua
parentd7cac5b8d0cde98ab4979c6e7602042511a27833 (diff)
add xpack to xmake/core
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)."})
+