Skip to content

Commit 0b1b3b6

Browse files
neeshyactboy168
andauthored
Don't override lm.bindir and lm.EXE_DIR in make.lua (#1977)
* Don't override lm.bindir and lm.EXE_DIR in make.lua These create targets "/main.lua" and "/bootstrap.lua" in build/build.ninja which in turn cause access violations during the build --------- Co-authored-by: actboy168 <actboy168@gmail.com>
1 parent 09f5ef6 commit 0b1b3b6

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

make.lua

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
local lm = require 'luamake'
22

3-
lm.bindir = "bin"
43
lm.c = lm.compiler == 'msvc' and 'c89' or 'c11'
54
lm.cxx = 'c++17'
65

@@ -15,9 +14,6 @@ if lm.sanitize then
1514
}
1615
end
1716

18-
---@diagnostic disable-next-line: codestyle-check
19-
lm.EXE_DIR = ""
20-
2117
local includeCodeFormat = true
2218

2319
require "make.detect_platform"
@@ -58,19 +54,28 @@ lm:executable "lua-language-server" {
5854
}
5955
}
6056

57+
local platform = require 'bee.platform'
58+
local exe = platform.OS == 'Windows' and ".exe" or ""
59+
60+
lm:copy "copy_lua-language-server" {
61+
input = lm.bindir .. "/lua-language-server" .. exe,
62+
output = "bin/lua-language-server" .. exe,
63+
}
64+
6165
lm:copy "copy_bootstrap" {
6266
input = "make/bootstrap.lua",
63-
output = lm.bindir .. "/main.lua",
67+
output = "bin/main.lua",
6468
}
6569

6670
lm:msvc_copydll 'copy_vcrt' {
6771
type = "vcrt",
68-
output = lm.bindir,
72+
output = "bin",
6973
}
7074

7175
lm:phony "all" {
7276
deps = {
7377
"lua-language-server",
78+
"copy_lua-language-server",
7479
"copy_bootstrap",
7580
},
7681
windows = {
@@ -87,11 +92,8 @@ if lm.notest then
8792
return
8893
end
8994

90-
local platform = require 'bee.platform'
91-
local exe = platform.OS == 'Windows' and ".exe" or ""
92-
9395
lm:rule "runtest" {
94-
lm.bindir .. "/lua-language-server" .. exe, "$in",
96+
"bin/lua-language-server" .. exe, "$in",
9597
description = "Run test: $in.",
9698
pool = "console",
9799
}

0 commit comments

Comments
 (0)