chore(build): viperc 路径集中为 VIPERC 常量并切换 vpcbuild3

- BuildKernel / BuildLibs / BuildApps 共用 VIPERC,去掉三处硬编码
- 指向 ViperC/__vpcbuild3__/output/viperc.exe
This commit is contained in:
TermiNexus committed 2026-10-27 12:43:19 +08:00
1 parent 632bc877df
commit 97ca7bbbdb
1 file changed
+9 -3
+9 -3
View File
@@ -4,6 +4,12 @@ import sys
import subprocess
# ============================================================================
# viperc 编译器路径 —— 唯一来源,改这里即可
# ============================================================================
VIPERC = r'..\..\ViperC\__vpcbuild3__\output\viperc.exe'
# 解析参数
clean = '--noclean' not in sys.argv
kernel_only = '--kernel-only' in sys.argv
@@ -41,7 +47,7 @@ if kernel_only and nokernel:
def BuildKernel():
"""编译内核:链接器一次产出带符号 kernel.elf,再由 objcopy 二次处理成裸镜像 kernel.bin"""
cmd = r'..\..\ViperC\__vpcbuild__\output\viperc.exe --project ./VKernel/project.vpj --clear-cache --rebuild-includes'
cmd = rf'{VIPERC} --project ./VKernel/project.vpj --clear-cache --rebuild-includes'
if clean:
cmd += ' --clean'
os.system(cmd)
@@ -78,7 +84,7 @@ def BuildLibs():
"""编译 Libs/ 下的动态库(应用运行期经 LOAD_SO 加载)。"""
os.makedirs("./disk/libs", exist_ok=True)
for proj, out in LIB_LIST:
cmd = rf'..\..\ViperC\__vpcbuild__\output\viperc.exe --project {proj}/project.vpj --clear-cache'
cmd = rf'{VIPERC} --project {proj}/project.vpj --clear-cache'
if clean:
cmd += ' --clean'
os.system(cmd)
@@ -123,7 +129,7 @@ def BuildApps():
for name, proj, out, dst in APP_LIST:
if app_filter is not None and name not in app_filter:
continue
cmd = rf'..\..\ViperC\__vpcbuild__\output\viperc.exe --project {proj}/project.vpj --clear-cache'
cmd = rf'{VIPERC} --project {proj}/project.vpj --clear-cache'
if clean:
cmd += ' --clean'
os.system(cmd)