Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
替换图标
  • Loading branch information
actboy168 committed Jan 23, 2019
commit c3be19d4c88fa8f544fd9742b3c400cfad5804a0
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "3rd/lpeglabel"]
path = 3rd/lpeglabel
url = https://github.com/sqmedeiros/lpeglabel
[submodule "3rd/rcedit"]
path = 3rd/rcedit
url = https://github.com/electron/rcedit
1 change: 1 addition & 0 deletions 3rd/rcedit
Submodule rcedit added at 6daf74
Binary file added images/icon.ico
Binary file not shown.
25 changes: 18 additions & 7 deletions make.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
local lm = require 'luamake'

lm.rootdir = '3rd/lni'
lm:lua_library 'lni' {
sources = "src/*.cpp"
sources = '3rd/lni/src/*.cpp'
}

lm.rootdir = '3rd/lpeglabel'
lm:lua_library 'lpeglabel' {
sources = "*.c"
sources = '3rd/lpeglabel/*.c'
}

lm:executable 'rcedit' {
sources = '3rd/rcedit/src/*.cc',
defines = {
'_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING'
},
flags = {
'/wd"C4477"',
'/wd"C4244"',
'/wd"C4267"',
}
}

lm:build 'bee' {
Expand All @@ -17,8 +27,9 @@ lm:build 'bee' {
lm:build 'install' {
'$luamake', 'lua', 'make/install.lua',
deps = {
"lni",
"lpeglabel",
"bee",
'lni',
'lpeglabel',
'bee',
'rcedit'
}
}
29 changes: 22 additions & 7 deletions make/install.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
local fs = require 'bee.filesystem'
local sp = require 'bee.subprocess'

local CWD = fs.current_path()

fs.create_directories(CWD / 'server' / 'bin')
fs.copy_file(CWD / 'build' / 'msvc' / 'bin' / 'lni.dll', CWD / 'server' / 'bin' / 'lni.dll', true)
fs.copy_file(CWD / 'build' / 'msvc' / 'bin' / 'lpeglabel.dll', CWD / 'server' / 'bin' / 'lpeglabel.dll', true)
fs.copy_file(CWD / '3rd' / 'bee.lua' / 'bin' / 'msvc_x86_release' / 'bee.dll', CWD / 'server' / 'bin' / 'bee.dll', true)
fs.copy_file(CWD / '3rd' / 'bee.lua' / 'bin' / 'msvc_x86_release' / 'lua54.dll', CWD / 'server' / 'bin' / 'lua54.dll', true)
fs.copy_file(CWD / '3rd' / 'bee.lua' / 'bin' / 'msvc_x86_release' / 'lua.exe', CWD / 'server' / 'bin' / 'lua-language-server.exe', true)
local output = CWD / 'server' / 'bin'
local bindir = CWD / 'build' / 'msvc' / 'bin'
local beedir = CWD / '3rd' / 'bee.lua' / 'bin' / 'msvc_x86_release'

fs.create_directories(output)
fs.copy_file(bindir / 'lni.dll', output / 'lni.dll', true)
fs.copy_file(bindir / 'lpeglabel.dll', output / 'lpeglabel.dll', true)
fs.copy_file(beedir / 'bee.dll', output / 'bee.dll', true)
fs.copy_file(beedir / 'lua54.dll', output / 'lua54.dll', true)
fs.copy_file(beedir / 'lua.exe', output / 'lua-language-server.exe', true)


local process = assert(sp.spawn {
bindir / 'rcedit.exe',
output / 'lua-language-server.exe',
'--set-icon',
CWD / 'images' / 'icon.ico'
})
assert(process:wait())


local msvc_crt = dofile 'make/msvc_crt.lua'
msvc_crt('x86', CWD / 'server' / 'bin')
msvc_crt('x86', output)