This commit is contained in:
恍兮惚兮 2024-11-15 03:04:53 +08:00
parent 2072333615
commit 660a926bc4
11 changed files with 52 additions and 15 deletions

View File

@ -66,10 +66,8 @@ cmake --build ../build/x64_{lang} --config Release --target ALL_BUILD -j 14
def build_langx_xp(lang): def build_langx_xp(lang):
url = "https://github.com/Chuyu-Team/YY-Thunks/releases/download/v1.0.7/YY-Thunks-1.0.7-Binary.zip" url = "https://github.com/Chuyu-Team/YY-Thunks/releases/download/v1.0.7/YY-Thunks-1.0.7-Binary.zip"
target = "YY-Thunks/objs/X86/YY_Thunks_for_WinXP.obj"
if os.path.exists(target) == False:
os.system(rf"curl -SLo YY-Thunks-1.0.7-Binary.zip " + url) os.system(rf"curl -SLo YY-Thunks-1.0.7-Binary.zip " + url)
os.system(rf"7z x -y YY-Thunks-1.0.7-Binary.zip -o../YY-Thunks") os.system(rf"7z x -y YY-Thunks-1.0.7-Binary.zip -o../../libs/YY-Thunks")
os.system("dir") os.system("dir")
with open("do.bat", "w") as ff: with open("do.bat", "w") as ff:
ff.write( ff.write(

View File

@ -205,7 +205,7 @@ def buildPlugins(arch):
f"cmake --build ../build/x86 --config Release --target ALL_BUILD -j 14" f"cmake --build ../build/x86 --config Release --target ALL_BUILD -j 14"
) )
# subprocess.run(f"python copytarget.py 1") # subprocess.run(f"python copytarget.py 1")
else: elif arch=='x64':
subprocess.run( subprocess.run(
f'cmake ../CMakeLists.txt -G "Visual Studio 17 2022" -A x64 -T host=x64 -B ../build/x64 -DCMAKE_SYSTEM_VERSION=10.0.26621.0' f'cmake ../CMakeLists.txt -G "Visual Studio 17 2022" -A x64 -T host=x64 -B ../build/x64 -DCMAKE_SYSTEM_VERSION=10.0.26621.0'
) )
@ -213,8 +213,20 @@ def buildPlugins(arch):
f"cmake --build ../build/x64 --config Release --target ALL_BUILD -j 14" f"cmake --build ../build/x64 --config Release --target ALL_BUILD -j 14"
) )
# subprocess.run(f"python copytarget.py 0") # subprocess.run(f"python copytarget.py 0")
elif arch=='xp':
url = "https://github.com/Chuyu-Team/YY-Thunks/releases/download/v1.0.7/YY-Thunks-1.0.7-Binary.zip"
os.system(rf"curl -SLo YY-Thunks-1.0.7-Binary.zip " + url)
os.system(rf"7z x -y YY-Thunks-1.0.7-Binary.zip -o../libs/YY-Thunks")
with open("do.bat", "w") as ff:
ff.write(
rf"""
cmake -DWINXP=ON ../CMakeLists.txt -G "Visual Studio 16 2019" -A win32 -T v141_xp -B ../build/x86_xp
cmake --build ../build/x86_xp --config Release --target ALL_BUILD -j 14
call dobuildxp.bat
"""
)
os.system(f"cmd /c do.bat")
def downloadsomething(): def downloadsomething():
pass pass
# shutil.rmtree(rootDir + "\\files\\LunaTranslator_qss\\.git") # shutil.rmtree(rootDir + "\\files\\LunaTranslator_qss\\.git")

View File

@ -2,6 +2,21 @@ name: buildluna
on: on:
workflow_call: workflow_call:
jobs: jobs:
build_cpp_xp:
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: GuillaumeFalourd/setup-windows10-sdk-action@v2
with:
sdk-version: 22621
- run: python .github/scripts/build_lunatranslator.py cpp xp
- uses: actions/upload-artifact@v4
with:
name: cpp_xp
path: cpp/builds
hook_xp: hook_xp:
runs-on: windows-2019 runs-on: windows-2019
permissions: permissions:

2
.gitignore vendored
View File

@ -46,5 +46,5 @@ cpp/libs/onnxruntime-static.zip
cpp/libs/onnxruntime-static/onnxruntime-static.7z cpp/libs/onnxruntime-static/onnxruntime-static.7z
cpp/libs/opencv-static/opencv-static.7z cpp/libs/opencv-static/opencv-static.7z
cpp/LunaHook/.vscode/settings.json cpp/LunaHook/.vscode/settings.json
cpp/LunaHook/YY-Thunks
cpp/LunaHook/scripts/YY-Thunks-1.0.7-Binary.zip cpp/LunaHook/scripts/YY-Thunks-1.0.7-Binary.zip
cpp/libs/YY-Thunks

View File

@ -40,10 +40,8 @@ option(WINXP "WINXP" OFF)
if(WINXP) if(WINXP)
set(WINXPAPP "_winxp") set(WINXPAPP "_winxp")
set(YY_Thunks_for_WinXP ${CMAKE_CURRENT_LIST_DIR}/YY-Thunks/objs/X86/YY_Thunks_for_WinXP.obj)
else() else()
set(WINXPAPP "") set(WINXPAPP "")
set(YY_Thunks_for_WinXP)
endif() endif()
add_definitions(-DLANGUAGE=${LANGUAGE}) add_definitions(-DLANGUAGE=${LANGUAGE})

View File

@ -14,7 +14,7 @@ set(OpenCV_STATIC ON)
find_package(OpenCV REQUIRED) find_package(OpenCV REQUIRED)
add_library(LunaOCR SHARED OCR.cpp ${versioninfo}) add_library(LunaOCR SHARED OCR.cpp ${versioninfo})
target_link_libraries(LunaOCR ${OnnxRuntime_LIBS} ${OpenCV_LIBS} Clipper2Lib) target_link_libraries(LunaOCR ${OnnxRuntime_LIBS} ${OpenCV_LIBS} Clipper2Lib ${YY_Thunks_for_WinXP})
target_precompile_headers(LunaOCR REUSE_FROM pch) target_precompile_headers(LunaOCR REUSE_FROM pch)
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)

View File

@ -18,8 +18,15 @@ set(sources PyStand.cpp luna.rc ${versioninfo})
add_executable(LunaTranslator_debug ${sources}) add_executable(LunaTranslator_debug ${sources})
target_compile_definitions(LunaTranslator_debug PRIVATE PYSTAND_CONSOLE) target_compile_definitions(LunaTranslator_debug PRIVATE PYSTAND_CONSOLE)
add_executable(LunaTranslator WIN32 ${sources}) add_executable(LunaTranslator WIN32 ${sources})
if(not WINXP)
add_executable(LunaTranslator_admin WIN32 ${sources}) add_executable(LunaTranslator_admin WIN32 ${sources})
set_target_properties(LunaTranslator_admin PROPERTIES LINK_FLAGS " /MANIFESTUAC:\"level='requireAdministrator' uiAccess='false'\" ") set_target_properties(LunaTranslator_admin PROPERTIES LINK_FLAGS " /MANIFESTUAC:\"level='requireAdministrator' uiAccess='false'\" ")
target_precompile_headers(LunaTranslator_debug REUSE_FROM pch)
target_precompile_headers(LunaTranslator_admin REUSE_FROM pch) target_precompile_headers(LunaTranslator_admin REUSE_FROM pch)
endif()
target_precompile_headers(LunaTranslator REUSE_FROM pch) target_precompile_headers(LunaTranslator REUSE_FROM pch)
target_precompile_headers(LunaTranslator_debug REUSE_FROM pch)
if(WINXP)
target_link_libraries(LunaTranslator ${YY_Thunks_for_WinXP})
target_link_libraries(LunaTranslator_debug ${YY_Thunks_for_WinXP})
endif()

View File

@ -45,3 +45,10 @@ set(OpenCV_ARCH x86)
endif() endif()
set(OpenCV_RUNTIME vc16) set(OpenCV_RUNTIME vc16)
endif() endif()
option(WINXP "WINXP" OFF)
if(WINXP)
set(YY_Thunks_for_WinXP ${CMAKE_CURRENT_LIST_DIR}/YY-Thunks/objs/X86/YY_Thunks_for_WinXP.obj)
else()
set(YY_Thunks_for_WinXP)
endif()

View File

@ -28,6 +28,6 @@ if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
set_target_properties(shareddllproxy PROPERTIES OUTPUT_NAME "shareddllproxy64") set_target_properties(shareddllproxy PROPERTIES OUTPUT_NAME "shareddllproxy64")
else() else()
target_precompile_headers(voiceroid2 REUSE_FROM pch) target_precompile_headers(voiceroid2 REUSE_FROM pch)
target_link_libraries(shareddllproxy nlohmann Mfplat mfuuid voiceroid2 Detours) target_link_libraries(shareddllproxy nlohmann Mfplat mfuuid voiceroid2 Detours ${YY_Thunks_for_WinXP})
set_target_properties(shareddllproxy PROPERTIES OUTPUT_NAME "shareddllproxy32") set_target_properties(shareddllproxy PROPERTIES OUTPUT_NAME "shareddllproxy32")
endif() endif()

View File

@ -25,6 +25,6 @@ if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
target_link_libraries(wcocr ${CMAKE_SOURCE_DIR}/libs/wechat-ocr/spt/x64/libprotobuf-lite.lib ${CMAKE_SOURCE_DIR}/libs/wechat-ocr/spt/x64/mmmojo_64.lib) target_link_libraries(wcocr ${CMAKE_SOURCE_DIR}/libs/wechat-ocr/spt/x64/libprotobuf-lite.lib ${CMAKE_SOURCE_DIR}/libs/wechat-ocr/spt/x64/mmmojo_64.lib)
target_link_options(wcocr PRIVATE "/DELAYLOAD:mmmojo_64.dll") target_link_options(wcocr PRIVATE "/DELAYLOAD:mmmojo_64.dll")
else() else()
target_link_libraries(wcocr ${CMAKE_SOURCE_DIR}/libs/wechat-ocr/spt/x86/libprotobuf-lite.lib ${CMAKE_SOURCE_DIR}/libs/wechat-ocr/spt/x86/mmmojo.lib) target_link_libraries(wcocr ${CMAKE_SOURCE_DIR}/libs/wechat-ocr/spt/x86/libprotobuf-lite.lib ${CMAKE_SOURCE_DIR}/libs/wechat-ocr/spt/x86/mmmojo.lib ${YY_Thunks_for_WinXP})
target_link_options(wcocr PRIVATE "/DELAYLOAD:mmmojo.dll") target_link_options(wcocr PRIVATE "/DELAYLOAD:mmmojo.dll")
endif() endif()

View File

@ -14,7 +14,7 @@ add_library(winsharedutils MODULE mp3enc.cpp webview2_extra.cpp AreoAcrylic.cpp
applicationloopbackaudio/runer.cpp applicationloopbackaudio/LoopbackCapture.cpp applicationloopbackaudio/runer.cpp applicationloopbackaudio/LoopbackCapture.cpp
SimpleBrowser.cpp MWebBrowser.cpp icon.cpp ${versioninfo}) SimpleBrowser.cpp MWebBrowser.cpp icon.cpp ${versioninfo})
target_precompile_headers(winsharedutils REUSE_FROM pch) target_precompile_headers(winsharedutils REUSE_FROM pch)
target_link_libraries(winsharedutils tinymp3 Shcore rapidfuzz wil webview2 Mfplat mfuuid Mmdevapi) target_link_libraries(winsharedutils tinymp3 Shcore rapidfuzz wil webview2 Mfplat mfuuid Mmdevapi ${YY_Thunks_for_WinXP})
target_link_options(winsharedutils PRIVATE "/DELAYLOAD:Mmdevapi.dll") target_link_options(winsharedutils PRIVATE "/DELAYLOAD:Mmdevapi.dll")
target_link_options(winsharedutils PRIVATE "/DELAYLOAD:Mfplat.dll") target_link_options(winsharedutils PRIVATE "/DELAYLOAD:Mfplat.dll")
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)