修复Windows编译问题

This commit is contained in:
2025-03-06 16:07:47 +08:00
parent c1e666ce5b
commit dc94573862
5 changed files with 98 additions and 98 deletions

View File

@ -104,6 +104,10 @@ async function downloadFromURL(name, url, resolver) {
fs.rmSync(outputDir, { force: true, recursive: true });
if (!checkFile(saveName)) {
console.log(`开始下载${name}, 地址:${url}`);
await fetch(url).then(res => {
console.log(res.status)
})
const result = spawnSync("curl", ["-o", saveName + ".cache", "-L", url, "-s", "-w", "%{http_code}"], { ...spawnOption, stdio: "pipe" });
assert(result.status == 0 && result.stdout.toString() == "200", `下载${name}失败`);
fs.renameSync(saveName + ".cache", saveName);
@ -154,7 +158,7 @@ async function main() {
`set(MNN_LIBS MNN)`,
].join("\n"));
//OpenCV
if (buildOptions.withOpenCV) cmakeBuildFromSource("OpenCV", "https://github.com/opencv/opencv.git", null, "4.11.0", [
if (buildOptions.withOpenCV) cmakeBuildFromSource("OpenCV", "https://github.com/opencv/opencv.git", "4.11.0", null, [
"-DBUILD_SHARED_LIBS=OFF",
"-DBUILD_opencv_apps=OFF",
"-DBUILD_opencv_js=OFF",