-
Notifications
You must be signed in to change notification settings - Fork 560
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build: xmake is now optional with xbuild.bat * chore: update llvm version in install-clang-format.bat
- Loading branch information
Showing
15 changed files
with
597 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
target("RimeWithWeasel") | ||
set_kind("static") | ||
add_files("./*.cpp") | ||
add_rules("use_weaselconstants") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
target("WeaselDeployer") | ||
set_kind("binary") | ||
add_files("./*.cpp") | ||
add_rules("add_rcfiles", "use_weaselconstants", "subwin") | ||
add_links("imm32", "kernel32", "rime") | ||
add_deps("WeaselIPC", "RimeWithWeasel") | ||
add_files("$(projectdir)/PerMonitorHighDPIAware.manifest") | ||
add_ldflags("/DEBUG /OPT:ICF /LARGEADDRESSAWARE /ERRORREPORT:QUEUE") | ||
before_build(function(target) | ||
local target_dir = path.join(target:targetdir(), target:name()) | ||
if not os.exists(target_dir) then | ||
os.mkdir(target_dir) | ||
end | ||
target:set("targetdir", target_dir) | ||
end) | ||
after_build(function(target) | ||
if is_arch("x86") then | ||
os.cp(path.join(target:targetdir(), "WeaselDeployer.exe"), "$(projectdir)/output/Win32") | ||
os.cp(path.join(target:targetdir(), "WeaselDeployer.pdb"), "$(projectdir)/output/Win32") | ||
else | ||
os.cp(path.join(target:targetdir(), "WeaselDeployer.exe"), "$(projectdir)/output") | ||
os.cp(path.join(target:targetdir(), "WeaselDeployer.pdb"), "$(projectdir)/output") | ||
end | ||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
target("WeaselIME") | ||
set_kind("shared") | ||
add_files("./*.cpp") | ||
add_rules("add_rcfiles") | ||
add_links("advapi32", "imm32", "user32", "gdi32") | ||
add_deps("WeaselIPC", "WeaselUI") | ||
local fname = '' | ||
|
||
before_build(function(target) | ||
local target_dir = path.join(target:targetdir(), target:name()) | ||
if not os.exists(target_dir) then | ||
os.mkdir(target_dir) | ||
end | ||
target:set("targetdir", target_dir) | ||
end) | ||
|
||
after_build(function(target) | ||
os.cp(path.join(target:targetdir(), "*.ime"), "$(projectdir)/output") | ||
end) | ||
if is_arch("x86") then | ||
fname = "weasel.ime" | ||
elseif is_arch("x64") then | ||
fname = "weaselx64.ime" | ||
elseif is_arch("arm") then | ||
fname = "weaselARM.ime" | ||
elseif is_arch("arm64") then | ||
fname = "weaselARM64.ime" | ||
end | ||
set_filename(fname) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
target("WeaselIPC") | ||
set_kind("static") | ||
add_files("./*.cpp") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
target("WeaselIPCServer") | ||
set_kind("static") | ||
add_files("./*.cpp") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
target("WeaselServer") | ||
set_kind("binary") | ||
add_files("./*.cpp") | ||
add_rules("add_rcfiles", "subwin") | ||
add_links("imm32", "kernel32", "rime") | ||
add_deps("WeaselUI", "WeaselIPC", "RimeWithWeasel", "WeaselIPCServer") | ||
|
||
add_files("$(projectdir)/PerMonitorHighDPIAware.manifest") | ||
add_ldflags("/DEBUG /OPT:REF /OPT:ICF /LARGEADDRESSAWARE /ERRORREPORT:QUEUE") | ||
set_policy("windows.manifest.uac", "invoker") | ||
before_build(function(target) | ||
local target_dir = path.join(target:targetdir(), target:name()) | ||
if not os.exists(target_dir) then | ||
os.mkdir(target_dir) | ||
end | ||
target:set("targetdir", target_dir) | ||
end) | ||
after_build(function(target) | ||
if is_arch("x86") then | ||
os.cp(path.join(target:targetdir(), "WeaselServer.exe"), "$(projectdir)/output/Win32") | ||
os.cp(path.join(target:targetdir(), "WeaselServer.pdb"), "$(projectdir)/output/Win32") | ||
else | ||
os.cp(path.join(target:targetdir(), "WeaselServer.exe"), "$(projectdir)/output") | ||
os.cp(path.join(target:targetdir(), "WeaselServer.pdb"), "$(projectdir)/output") | ||
end | ||
end) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
target("WeaselSetup") | ||
set_kind("binary") | ||
add_files("./*.cpp") | ||
add_rules("add_rcfiles", "use_weaselconstants", "subwin") | ||
add_links("imm32", "kernel32") | ||
|
||
set_policy("windows.manifest.uac", "admin") | ||
add_files("$(projectdir)/PerMonitorHighDPIAware.manifest") | ||
add_ldflags("/DEBUG /OPT:REF /OPT:ICF /LARGEADDRESSAWARE /ERRORREPORT:QUEUE") | ||
|
||
before_build(function(target) | ||
local target_dir = path.join(target:targetdir(), target:name()) | ||
if not os.exists(target_dir) then | ||
os.mkdir(target_dir) | ||
end | ||
target:set("targetdir", target_dir) | ||
local level = target:policy("windows.manifest.uac") | ||
if level then | ||
local level_maps = { | ||
invoker = "asInvoker", | ||
admin = "requireAdministrator", | ||
highest = "highestAvailable" | ||
} | ||
assert(level_maps[level], "unknown uac level %s, please set invoker, admin or highest", level) | ||
local ui = target:policy("windows.manifest.uac.ui") or false | ||
target:add("ldflags", "/manifest:embed", {("/manifestuac:level='%s' uiAccess='%s'"):format(level_maps[level], ui)}, {force = true, expand = false}) | ||
end | ||
end) | ||
|
||
after_build(function(target) | ||
os.cp(path.join(target:targetdir(), "WeaselSetup.exe"), "$(projectdir)/output") | ||
os.cp(path.join(target:targetdir(), "WeaselSetup.pdb"), "$(projectdir)/output") | ||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
target("WeaselTSF") | ||
set_kind("shared") | ||
add_files("./*.cpp", "WeaselTSF.def") | ||
add_rules("add_rcfiles", "use_weaselconstants") | ||
add_deps("WeaselIPC", "WeaselUI") | ||
local fname = '' | ||
if is_arch("x86") then | ||
fname = "weasel.dll" | ||
elseif is_arch("x64") then | ||
fname = "weaselx64.dll" | ||
elseif is_arch("arm") then | ||
fname = "weaselARM.dll" | ||
elseif is_arch("arm64") then | ||
fname = "weaselARM64.dll" | ||
end | ||
set_filename(fname) | ||
|
||
add_files("$(projectdir)/PerMonitorHighDPIAware.manifest") | ||
add_shflags("/DEBUG /OPT:REF /OPT:ICF") | ||
before_build(function(target) | ||
local target_dir = path.join(target:targetdir(), target:name()) | ||
if not os.exists(target_dir) then | ||
os.mkdir(target_dir) | ||
end | ||
target:set("targetdir", target_dir) | ||
end) | ||
|
||
after_build(function(target) | ||
os.cp(path.join(target:targetdir(), "weasel*.dll"), "$(projectdir)/output") | ||
os.cp(path.join(target:targetdir(), "weasel*.pdb"), "$(projectdir)/output") | ||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
target("WeaselUI") | ||
set_kind("static") | ||
add_files("./*.cpp") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
target("TestResponseParser") | ||
set_kind("binary") | ||
add_files("./*.cpp") | ||
add_deps("WeaselIPC", "WeaselIPCServer") | ||
add_rules("subcmd") | ||
before_build(function(target) | ||
local target_dir = path.join(target:targetdir(), target:name()) | ||
if not os.exists(target_dir) then | ||
os.mkdir(target_dir) | ||
end | ||
target:set("targetdir", target_dir) | ||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
target("TestWeaselIPC") | ||
set_kind("binary") | ||
add_files("./*.cpp") | ||
add_deps("WeaselIPC", "WeaselIPCServer") | ||
add_rules("subcmd") | ||
before_build(function(target) | ||
local target_dir = path.join(target:targetdir(), target:name()) | ||
if not os.exists(target_dir) then | ||
os.mkdir(target_dir) | ||
end | ||
target:set("targetdir", target_dir) | ||
end) |
Oops, something went wrong.