summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-06-02 22:50:57 +0800
committerruki <[email protected]>2021-06-02 22:50:57 +0800
commit16919177c72aa5934113d37932e0b60c8d4a52df (patch)
treefc6faf07b2eb3fccde422037735835d36b8241c9
parenteee121636be554cdeef8907bd0d2fac6a23304a6 (diff)
detect unicode target name
-rw-r--r--xmake/actions/package/local/main.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/xmake/actions/package/local/main.lua b/xmake/actions/package/local/main.lua
index c2b3c556c..aa834eb79 100644
--- a/xmake/actions/package/local/main.lua
+++ b/xmake/actions/package/local/main.lua
@@ -24,6 +24,7 @@ import("core.base.task")
import("core.project.rule")
import("core.project.config")
import("core.project.project")
+import("lib.luajit.bit")
-- package binary
function _package_binary(target)
@@ -31,6 +32,10 @@ function _package_binary(target)
-- get the output directory
local outputdir = option.get("outputdir") or config.buildir()
local packagename = target:name():lower()
+ if bit.band(packagename:byte(2), 0xc0) == 0x80 then
+ wprint("package(%s): cannot generate package, becauese it contains unicode characters!", packagename)
+ return
+ end
local packagedir = path.join(outputdir, "packages", packagename:sub(1, 1), packagename)
local binarydir = path.join(packagedir, target:plat(), target:arch(), config.mode(), "bin")
@@ -64,6 +69,10 @@ function _package_library(target)
-- get the output directory
local outputdir = option.get("outputdir") or config.buildir()
local packagename = target:name():lower()
+ if bit.band(packagename:byte(2), 0xc0) == 0x80 then
+ wprint("package(%s): cannot generate package, becauese it contains unicode characters!", packagename)
+ return
+ end
local packagedir = path.join(outputdir, "packages", packagename:sub(1, 1), packagename)
local binarydir = path.join(packagedir, target:plat(), target:arch(), config.mode(), "bin")
local librarydir = path.join(packagedir, target:plat(), target:arch(), config.mode(), "lib")