xp target

1
This commit is contained in:
恍兮惚兮 2024-02-11 20:54:45 +08:00
parent 165e18f9e6
commit 533e0c8809
3 changed files with 84 additions and 3 deletions

View File

@ -57,7 +57,7 @@
#define MenuRemovePlugin L"移除插件"
#define MenuPluginRankUp L"上移"
#define MenuPluginRankDown L"下移"
#define DefaultFont L"微软雅黑"
#define DefaultFont L""
#define InVaildPlugin L"无效的插件"
#define CantLoadQtLoader L"无法加载QtLoader.dll"
#define LblPluginNotify L"依赖于Qt的插件仅会在启动时载入。"

View File

@ -1,2 +1,70 @@
cmake ../CMakeLists.txt -G "Visual Studio 15 2017" -A win32 -T v141_xp -B ../build/xp
cmake --build ../build/xp --config Release --target ALL_BUILD -j 14
@REM cmake ../CMakeLists.txt -G "Visual Studio 15 2017" -A win32 -T v141_xp -B ../build/xp
@REM cmake --build ../build/xp --config Release --target ALL_BUILD -j 14
cmake ../CMakeLists.txt -G "Visual Studio 17 2022" -A win32 -T host=x86 -B ../build/x86_xp
cmake -DLANGUAGE=Chinese ../CMakeLists.txt -G "Visual Studio 17 2022" -A win32 -T host=x86 -B ../build/x86_zh_xp
python edit_target.py
@echo off
setlocal enabledelayedexpansion
goto :main
:get_host_arch
setlocal
set out_var=%~1
if defined PROCESSOR_ARCHITEW6432 (
set "host_arch=%PROCESSOR_ARCHITEW6432%"
) else (
set "host_arch=%PROCESSOR_ARCHITECTURE%"
)
if "%host_arch%" == "AMD64" (
set result=x64
) else if "%host_arch%" == "x86" (
set result=x86
) else (
echo ERROR: Unsupported host machine architecture.
endlocal
exit /b 1
)
endlocal & set %out_var%=%result%
goto :eof
:find_msvc
setlocal
set out_var=%~1
rem Find vswhere.exe
set "vswhere=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
if not exist "%vswhere%" set "vswhere=!ProgramFiles!\Microsoft Visual Studio\Installer\vswhere.exe"
if not exist "%vswhere%" (
echo ERROR: Failed to find vswhere.exe>&2
endlocal & exit /b 1
)
rem Find VC tools
for /f "usebackq tokens=*" %%i in (`"%vswhere%" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
set vc_dir=%%i
)
if not exist "%vc_dir%\Common7\Tools\vsdevcmd.bat" (
echo ERROR: Failed to find MSVC.>&2
endlocal & exit /b 1
)
endlocal & set "%out_var%=%vc_dir%"
goto :eof
:activate_msvc
where cl.exe > nul 2>&1 && goto :eof || cmd /c exit 0
call :find_msvc vc_dir || goto :eof
call "%vc_dir%\Common7\Tools\vsdevcmd.bat" -no_logo -arch=%~1 || goto :eof
goto :eof
:main
call :get_host_arch host_arch || exit /b
if not defined TARGET_ARCH (
rem Target architecture is by default the same as the host architecture
set target_arch=%host_arch%
)
call :activate_msvc "%target_arch%" || goto :eof
msbuild C:\Users\wcy\Documents\GitHub\LunaHook\build\x86_xp\LunaHook.sln -p:Configuration=Release
msbuild C:\Users\wcy\Documents\GitHub\LunaHook\build\x86_zh_xp\LunaHook.sln -p:Configuration=Release
rem C:\Users\wcy\Documents\GitHub\LunaHook\build\x86\LunaHook.sln
goto :eof

13
scripts/edit_target.py Normal file
View File

@ -0,0 +1,13 @@
import os
#妈的不知道为什么我重装系统后装了vs2017 cmake也识别不到只能手动改了。
for f in ['../build/x86_zh_xp','../build/x86_xp']:
for dirname,_,fs in os.walk(f):
for ff in fs:
if ff.endswith('.vcxproj')==False:continue
if ff.endswith('QtLoader.vcxproj'):continue
path=os.path.join(dirname,ff)
with open(path,'r',encoding='utf-8-sig') as pf:
file=pf.read()
file=file.replace('>v143<','>v141_xp<')
with open(path,'w',encoding='utf-8-sig') as pf:
pf.write(file)