1- local lm = require ' luamake'
2- local platform = require ' bee.platform'
3- local exe = platform .OS == ' Windows' and " .exe" or " "
1+ local lm = require ' luamake'
42
53lm .bindir = " bin"
64lm .c = lm .compiler == ' msvc' and ' c89' or ' c11'
@@ -11,35 +9,9 @@ lm.EXE_DIR = ""
119
1210local includeCodeFormat = true
1311
14- if platform .OS == ' macOS' then
15- if lm .platform == nil then
16- elseif lm .platform == " darwin-arm64" then
17- lm .target = " arm64-apple-macos11"
18- elseif lm .platform == " darwin-x64" then
19- lm .target = " x86_64-apple-macos10.12"
20- else
21- error " unknown platform"
22- end
23- elseif platform .OS == ' Windows' then
24- if lm .platform == nil then
25- elseif lm .platform == " win32-ia32" then
26- lm .arch = " x86"
27- elseif lm .platform == " win32-x64" then
28- lm .arch = " x86_64"
29- else
30- error " unknown platform"
31- end
32- elseif platform .OS == ' Linux' then
33- if lm .platform == nil then
34- elseif lm .platform == " linux-x64" then
35- elseif lm .platform == " linux-arm64" then
36- lm .cc = ' aarch64-linux-gnu-gcc'
37- else
38- error " unknown platform"
39- end
40- end
12+ require " make.detect_platform"
4113
42- lm :import " 3rd/bee.lua/make.lua "
14+ lm :import " 3rd/bee.lua"
4315lm :import " make/code_format.lua"
4416
4517lm :source_set ' lpeglabel' {
@@ -80,8 +52,8 @@ lm:copy "copy_bootstrap" {
8052 output = lm .bindir .. " /main.lua" ,
8153}
8254
83- lm :build ' copy_vcrt' {
84- ' $luamake ' , ' lua ' , ' make/copy_vcrt.lua ' , lm .bindir , lm . arch ,
55+ lm :msvc_copy_vcrt ' copy_vcrt' {
56+ output = lm .bindir ,
8557}
8658
8759lm :phony " all" {
@@ -96,46 +68,16 @@ lm:phony "all" {
9668 }
9769}
9870
99- local function detectWindowsArch ()
100- if os.getenv " PROCESSOR_ARCHITECTURE" == " ARM64" then
101- return " arm64"
102- end
103- if os.getenv " PROCESSOR_ARCHITECTURE" == " AMD64" or os.getenv " PROCESSOR_ARCHITEW6432" == " AMD64" then
104- return " x64"
105- end
106- return " ia32"
107- end
108-
109- local function detectPosixArch ()
110- local f <close> = assert (io.popen (" uname -m" , ' r' ))
111- return f :read ' l' :lower ()
112- end
113-
114- local function detectArch ()
115- if platform .OS == ' Windows' then
116- return detectWindowsArch ()
117- end
118- return detectPosixArch ()
119- end
120-
121- local function targetPlatformArch ()
122- if lm .platform == nil then
123- return detectArch ()
124- end
125- return lm .platform :match " ^[^-]*-(.*)$"
126- end
127-
128- local notest = (platform .OS == ' macOS' or platform .OS == ' Linux' )
129- and targetPlatformArch () == " arm64"
130- and detectArch () == " x86_64"
131-
132- if notest then
71+ if lm .notest then
13372 lm :default {
13473 " all" ,
13574 }
13675 return
13776end
13877
78+ local platform = require ' bee.platform'
79+ local exe = platform .OS == ' Windows' and " .exe" or " "
80+
13981lm :build " bee-test" {
14082 lm .bindir .. " /lua-language-server" .. exe , " 3rd/bee.lua/test/test.lua" ,
14183 pool = " console" ,
0 commit comments