From 3764cc615a7a6ee08ad1fa287f152e9c1f95cc5c Mon Sep 17 00:00:00 2001 From: Alan Alwakeel <51007646+OfficialDelta@users.noreply.github.com> Date: Thu, 19 Mar 2026 17:28:44 -0400 Subject: [PATCH] Respect CARGO_TARGET_DIR in native build script (#1441) --- native/scripts/build.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/native/scripts/build.js b/native/scripts/build.js index 25a52ba54..65d270a94 100644 --- a/native/scripts/build.js +++ b/native/scripts/build.js @@ -44,7 +44,11 @@ try { } // Locate the built library -const targetDir = path.join(nativeRoot, "target", profile); +const cargoTargetRoot = process.env.CARGO_TARGET_DIR + ? path.resolve(process.env.CARGO_TARGET_DIR) + : path.join(nativeRoot, "target"); + +const targetDir = path.join(cargoTargetRoot, profile); const platformTag = `${process.platform}-${process.arch}`; const libraryNames = {