forked from rime/weasel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add build script for ARM64X redirection DLLs
- Loading branch information
1 parent
2f48397
commit aa964f6
Showing
8 changed files
with
110 additions
and
0 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,16 @@ | ||
EXPORTS | ||
ImeConversionList = weaselARM64.ime.ImeConversionList | ||
ImeConfigure = weaselARM64.ime.ImeConfigure | ||
ImeDestroy = weaselARM64.ime.ImeDestroy | ||
ImeEscape = weaselARM64.ime.ImeEscape | ||
ImeInquire = weaselARM64.ime.ImeInquire | ||
ImeProcessKey = weaselARM64.ime.ImeProcessKey | ||
ImeSelect = weaselARM64.ime.ImeSelect | ||
ImeSetActiveContext = weaselARM64.ime.ImeSetActiveContext | ||
ImeToAsciiEx = weaselARM64.ime.ImeToAsciiEx | ||
NotifyIME = weaselARM64.ime.NotifyIME | ||
ImeRegisterWord = weaselARM64.ime.ImeRegisterWord | ||
ImeUnregisterWord = weaselARM64.ime.ImeUnregisterWord | ||
ImeGetRegisterWordStyle = weaselARM64.ime.ImeGetRegisterWordStyle | ||
ImeEnumRegisterWord = weaselARM64.ime.ImeEnumRegisterWord | ||
ImeSetCompositionString = weaselARM64.ime.ImeSetCompositionString |
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,16 @@ | ||
EXPORTS | ||
ImeConversionList = weaselx64.ime.ImeConversionList | ||
ImeConfigure = weaselx64.ime.ImeConfigure | ||
ImeDestroy = weaselx64.ime.ImeDestroy | ||
ImeEscape = weaselx64.ime.ImeEscape | ||
ImeInquire = weaselx64.ime.ImeInquire | ||
ImeProcessKey = weaselx64.ime.ImeProcessKey | ||
ImeSelect = weaselx64.ime.ImeSelect | ||
ImeSetActiveContext = weaselx64.ime.ImeSetActiveContext | ||
ImeToAsciiEx = weaselx64.ime.ImeToAsciiEx | ||
NotifyIME = weaselx64.ime.NotifyIME | ||
ImeRegisterWord = weaselx64.ime.ImeRegisterWord | ||
ImeUnregisterWord = weaselx64.ime.ImeUnregisterWord | ||
ImeGetRegisterWordStyle = weaselx64.ime.ImeGetRegisterWordStyle | ||
ImeEnumRegisterWord = weaselx64.ime.ImeEnumRegisterWord | ||
ImeSetCompositionString = weaselx64.ime.ImeSetCompositionString |
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 @@ | ||
EXPORTS | ||
DllGetClassObject = weaselARM64.dll.DllGetClassObject | ||
DllCanUnloadNow = weaselARM64.dll.DllCanUnloadNow | ||
DllRegisterServer = weaselARM64.dll.DllRegisterServer | ||
DllUnregisterServer = weaselARM64.dll.DllUnregisterServer |
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 @@ | ||
EXPORTS | ||
DllGetClassObject = weaselx64.dll.DllGetClassObject | ||
DllCanUnloadNow = weaselx64.dll.DllCanUnloadNow | ||
DllRegisterServer = weaselx64.dll.DllRegisterServer | ||
DllUnregisterServer = weaselx64.dll.DllUnregisterServer |
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,50 @@ | ||
|
||
@echo off | ||
setlocal | ||
|
||
call :find_toolchain | ||
if errorlevel 1 exit /b 1 | ||
|
||
REM Build dummy object files | ||
cl.exe /c /Fo:dummy.o dummy.c || exit /b 1 | ||
cl.exe /c /arm64EC /Fo:dummy_x64.o dummy.c || exit /b 1 | ||
|
||
REM Build weasel.dll wrapper | ||
link.exe /lib /machine:x64 /def:WeaselTSF_x64.def /out:WeaselTSF_x64.lib /ignore:4104 | ||
link.exe /lib /machine:arm64 /def:WeaselTSF_arm64.def /out:WeaselTSF_arm64.lib /ignore:4104 | ||
link.exe /dll /noentry /machine:arm64x /defArm64Native:WeaselTSF_arm64.def /def:WeaselTSF_x64.def ^ | ||
/out:weaselARM64X.dll dummy.o dummy_x64.o WeaselTSF_x64.lib WeaselTSF_arm64.lib /ignore:4104 | ||
|
||
REM Build weasel.ime wrapper | ||
link.exe /lib /machine:x64 /def:WeaselIME_x64.def /out:WeaselIME_x64.lib /ignore:4104 | ||
link.exe /lib /machine:arm64 /def:WeaselIME_arm64.def /out:WeaselIME_arm64.lib /ignore:4104 | ||
link.exe /dll /noentry /machine:arm64x /defArm64Native:WeaselIME_arm64.def /def:WeaselIME_x64.def ^ | ||
/out:weaselARM64X.ime dummy.o dummy_x64.o WeaselIME_x64.lib WeaselIME_arm64.lib /ignore:4104 | ||
|
||
endlocal | ||
exit /b | ||
|
||
:find_toolchain | ||
set VSWHERE="%PROGRAMFILES%\Microsoft Visual Studio\Installer\vswhere.exe" | ||
if not exist %VSWHERE% ( | ||
set VSWHERE="%PROGRAMFILES(X86)%\Microsoft Visual Studio\Installer\vswhere.exe" | ||
) | ||
if not exist %VSWHERE% ( | ||
echo vswhere not found, could not find a working MSVC install. | ||
exit /b 1 | ||
) | ||
|
||
for /f "usebackq tokens=*" %%i in (`%VSWHERE% -latest -requires Microsoft.VisualStudio.Component.VC.Tools.ARM64EC -property installationPath`) do ( | ||
set ARM64EC_TOOLCHAIN=%%i | ||
) | ||
|
||
if exist "%ARM64EC_TOOLCHAIN%\Common7\Tools\vsdevcmd.bat" ( | ||
call "%ARM64EC_TOOLCHAIN%\Common7\Tools\vsdevcmd.bat" -arch=arm64 -host_arch=x86 | ||
echo. | ||
) else ( | ||
echo ARM64EC capable toolchain not found | ||
exit /b 1 | ||
) | ||
|
||
exit /b | ||
|
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 @@ | ||
// This file is left blank on purpose to invoke the ARM64EC compiler and build ARM64EC thunks. |
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