Skip to content

Commit ce03710

Browse files
authored
Update make.lua
1 parent 2759c9a commit ce03710

File tree

1 file changed

+49
-7
lines changed

1 file changed

+49
-7
lines changed

make.lua

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,11 @@ lm:copy "copy_bootstrap" {
5555
output = lm.bindir.."/main.lua",
5656
}
5757

58-
if lm.target == 'arm64-apple-macos11' then
59-
return
60-
end
61-
6258
lm:build 'copy_vcrt' {
6359
'$luamake', 'lua', 'make/copy_vcrt.lua', lm.bindir, lm.arch,
6460
}
6561

66-
lm:build "bee-test" {
67-
lm.bindir.."/lua-language-server"..exe, "3rd/bee.lua/test/test.lua",
68-
pool = "console",
62+
lm:phony "all" {
6963
deps = {
7064
"lua-language-server",
7165
"copy_bootstrap",
@@ -77,6 +71,54 @@ lm:build "bee-test" {
7771
}
7872
}
7973

74+
local function detectWindowsArch()
75+
if os.getenv "PROCESSOR_ARCHITECTURE" == "ARM64" then
76+
return "arm64"
77+
end
78+
if os.getenv "PROCESSOR_ARCHITECTURE" == "AMD64" or os.getenv "PROCESSOR_ARCHITEW6432" == "AMD64" then
79+
return "x64"
80+
end
81+
return "ia32"
82+
end
83+
84+
local function detectPosixArch()
85+
local f <close> = assert(io.popen("uname -m", 'r'))
86+
return f:read 'l':lower()
87+
end
88+
89+
local function detectArch()
90+
if platform.OS == 'Windows' then
91+
return detectWindowsArch()
92+
end
93+
return detectPosixArch()
94+
end
95+
96+
local function targetPlatformArch()
97+
if lm.platform == nil then
98+
return detectArch()
99+
end
100+
return lm.platform:match "^[^-]*-(.*)$"
101+
end
102+
103+
local notest = platform.OS == 'macOS'
104+
and targetPlatformArch() == "arm64"
105+
and detectArch() == "x64"
106+
107+
if notest then
108+
lm:default {
109+
"all",
110+
}
111+
return
112+
end
113+
114+
lm:build "bee-test" {
115+
lm.bindir.."/lua-language-server"..exe, "3rd/bee.lua/test/test.lua",
116+
pool = "console",
117+
deps = {
118+
"all",
119+
}
120+
}
121+
80122
lm:build 'unit-test' {
81123
lm.bindir.."/lua-language-server"..exe, 'test.lua',
82124
pool = "console",

0 commit comments

Comments
 (0)