Skip to content

Commit

Permalink
Don't override lm.bindir and lm.EXE_DIR in make.lua (#1977)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
neeshy and actboy168 committed Mar 6, 2023
1 parent 09f5ef6 commit 0b1b3b6
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions make.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
local lm = require 'luamake'

lm.bindir = "bin"
lm.c = lm.compiler == 'msvc' and 'c89' or 'c11'
lm.cxx = 'c++17'

Expand All @@ -15,9 +14,6 @@ if lm.sanitize then
}
end

---@diagnostic disable-next-line: codestyle-check
lm.EXE_DIR = ""

local includeCodeFormat = true

require "make.detect_platform"
Expand Down Expand Up @@ -58,19 +54,28 @@ lm:executable "lua-language-server" {
}
}

local platform = require 'bee.platform'
local exe = platform.OS == 'Windows' and ".exe" or ""

lm:copy "copy_lua-language-server" {
input = lm.bindir .. "/lua-language-server" .. exe,
output = "bin/lua-language-server" .. exe,
}

lm:copy "copy_bootstrap" {
input = "make/bootstrap.lua",
output = lm.bindir .. "/main.lua",
output = "bin/main.lua",
}

lm:msvc_copydll 'copy_vcrt' {
type = "vcrt",
output = lm.bindir,
output = "bin",
}

lm:phony "all" {
deps = {
"lua-language-server",
"copy_lua-language-server",
"copy_bootstrap",
},
windows = {
Expand All @@ -87,11 +92,8 @@ if lm.notest then
return
end

local platform = require 'bee.platform'
local exe = platform.OS == 'Windows' and ".exe" or ""

lm:rule "runtest" {
lm.bindir .. "/lua-language-server" .. exe, "$in",
"bin/lua-language-server" .. exe, "$in",
description = "Run test: $in.",
pool = "console",
}
Expand Down

0 comments on commit 0b1b3b6

Please sign in to comment.