Skip to content

Commit 298c723

Browse files
committed
Copy DLLs to both binary dir and sketch folder for runtime access
1 parent d03a8bc commit 298c723

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

mode/CppMode.jar

38 Bytes
Binary file not shown.

src/java/CppBuild.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -664,16 +664,20 @@ private void checkWindowsDLLs(RunnerListener listener, File binary) throws Excep
664664
binaryDir.mkdirs();
665665

666666
for (String dll : allDlls) {
667-
File dest = new File(binaryDir, dll);
668-
if (dest.exists()) continue;
669667
File src2 = new File(bundledDir, dll);
670-
if (src2.exists()) {
671-
try { java.nio.file.Files.copy(src2.toPath(), dest.toPath(),
672-
java.nio.file.StandardCopyOption.REPLACE_EXISTING); }
673-
catch (Exception e) {
674-
System.err.println("[CppMode] Failed to copy " + dll + ": " + e.getMessage());
675-
}
668+
if (!src2.exists()) continue;
669+
// Copy to binary dir (next to the exe)
670+
File dest = new File(binaryDir, dll);
671+
try { java.nio.file.Files.copy(src2.toPath(), dest.toPath(),
672+
java.nio.file.StandardCopyOption.REPLACE_EXISTING);
673+
} catch (Exception e) {
674+
System.err.println("[CppMode] Failed to copy " + dll + ": " + e.getMessage());
676675
}
676+
// Also copy to sketch folder so the sketch can find them when run
677+
File sketchDest = new File(binary.getParentFile().getParentFile(), dll);
678+
try { java.nio.file.Files.copy(src2.toPath(), sketchDest.toPath(),
679+
java.nio.file.StandardCopyOption.REPLACE_EXISTING);
680+
} catch (Exception ignored) {}
677681
}
678682

679683
// If all required DLLs exist in bundledDir, we're good -- they were

0 commit comments

Comments
 (0)