Archived
tauri:dev/tauri:build schalten auf macOS native2d dazu (DOSSIER_NO_NATIVE2D=1 als Opt-out)
This commit is contained in:
1 parent
129516073c
commit
8c3655956c
2 files changed
+14
-2
No files matched your search
+2
-2
@@ -12,8 +12,8 @@
|
|||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"test:watch": "vitest",
|
"test:watch": "vitest",
|
||||||
"tauri": "tauri",
|
"tauri": "tauri",
|
||||||
"tauri:dev": "tauri dev",
|
"tauri:dev": "node scripts/tauri-native.mjs dev",
|
||||||
"tauri:build": "tauri build",
|
"tauri:build": "node scripts/tauri-native.mjs build",
|
||||||
"dump:native": "node scripts/dump-native-scene.mjs",
|
"dump:native": "node scripts/dump-native-scene.mjs",
|
||||||
"shell": "scripts/chromium-shell.sh",
|
"shell": "scripts/chromium-shell.sh",
|
||||||
"electron": "scripts/electron-shell.sh",
|
"electron": "scripts/electron-shell.sh",
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
// Startet `tauri dev|build` und schaltet auf macOS das Cargo-Feature `native2d`
|
||||||
|
// dazu (native 2D-Engine in der eingebetteten Metal-Fläche, s.
|
||||||
|
// src-tauri/src/native_embed.rs). Auf anderen Plattformen läuft der Standard-Build
|
||||||
|
// unverändert mit WebGL. Opt-out: DOSSIER_NO_NATIVE2D=1.
|
||||||
|
import { spawn } from "node:child_process";
|
||||||
|
|
||||||
|
const args = process.argv.slice(2);
|
||||||
|
const native = process.platform === "darwin" && !process.env.DOSSIER_NO_NATIVE2D;
|
||||||
|
if (native && !args.includes("--features")) args.push("--features", "native2d");
|
||||||
|
console.log(`[tauri-native] tauri ${args.join(" ")}`);
|
||||||
|
const child = spawn("npx", ["tauri", ...args], { stdio: "inherit" });
|
||||||
|
child.on("exit", (code, signal) => process.exit(code ?? (signal ? 1 : 0)));
|
||||||
Reference in new issue
Block a user