This commit is contained in:
恍兮惚兮 2024-11-07 22:50:54 +08:00
parent 04c2c6675a
commit 8031da4ea2
2 changed files with 13 additions and 7 deletions

View File

@ -18,7 +18,7 @@ jobs:
- uses: GuillaumeFalourd/setup-windows10-sdk-action@v2 - uses: GuillaumeFalourd/setup-windows10-sdk-action@v2
with: with:
sdk-version: 22621 sdk-version: 22621
- run: python cpp/LunaHook/build.py build English ${{matrix.bits}} - run: python cpp/LunaHook/build.py build English ${{matrix.bits}} 1
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
with: with:

View File

@ -52,19 +52,24 @@ def installVCLTL():
subprocess.run("cmd /c temp\\VC-LTL5\\Install.cmd") subprocess.run("cmd /c temp\\VC-LTL5\\Install.cmd")
def build_langx(lang, bit): def build_langx(lang, bit, onlycore):
config = (
f"-DBUILD_PLUGIN=OFF -DWINXP=OFF -DLANGUAGE={lang} -DBUILD_GUI=ON -DBUILD_CLI=ON"
if not onlycore
else ""
)
with open("do.bat", "w") as ff: with open("do.bat", "w") as ff:
if bit == "32": if bit == "32":
ff.write( ff.write(
rf""" rf"""
cmake -DBUILD_PLUGIN=OFF -DWINXP=OFF -DLANGUAGE={lang} -DBUILD_GUI=ON -DBUILD_CLI=ON ../CMakeLists.txt -G "Visual Studio 17 2022" -A win32 -T host=x86 -B ../build/x86_{lang} cmake {config} ../CMakeLists.txt -G "Visual Studio 17 2022" -A win32 -T host=x86 -B ../build/x86_{lang}
cmake --build ../build/x86_{lang} --config Release --target ALL_BUILD -j 14 cmake --build ../build/x86_{lang} --config Release --target ALL_BUILD -j 14
""" """
) )
elif bit == "64": elif bit == "64":
ff.write( ff.write(
rf""" rf"""
cmake -DBUILD_PLUGIN=OFF -DWINXP=OFF -DLANGUAGE={lang} -DBUILD_GUI=ON -DBUILD_CLI=ON ../CMakeLists.txt -G "Visual Studio 17 2022" -A x64 -T host=x64 -B ../build/x64_{lang} cmake {config} ../CMakeLists.txt -G "Visual Studio 17 2022" -A x64 -T host=x64 -B ../build/x64_{lang}
cmake --build ../build/x64_{lang} --config Release --target ALL_BUILD -j 14 cmake --build ../build/x64_{lang} --config Release --target ALL_BUILD -j 14
""" """
) )
@ -76,8 +81,8 @@ def build_langx_xp(lang):
target = "YY-Thunks/objs/X86/YY_Thunks_for_WinXP.obj" target = "YY-Thunks/objs/X86/YY_Thunks_for_WinXP.obj"
if os.path.exists(target) == False: 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../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(
rf""" rf"""
@ -102,4 +107,5 @@ elif sys.argv[1] == "build":
if bit == "winxp": if bit == "winxp":
build_langx_xp(lang) build_langx_xp(lang)
else: else:
build_langx(lang, bit) onlycore = int(sys.argv[4]) if len(sys.argv) >= 5 else False
build_langx(lang, bit, onlycore)