Skip to content

Commit 58d132d

Browse files
committed
macOS: strip quarantine attribute from bundled dylibs before linking
1 parent 5603d53 commit 58d132d

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

mode/CppMode.jar

96 Bytes
Binary file not shown.

src/java/CppBuild.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3261,6 +3261,11 @@ else if (!cmd.contains(defaultsCpp.getAbsolutePath()))
32613261
boolean hasBundled = new File(macLibsDir, "libglfw.3.dylib").exists()
32623262
&& new File(macLibsDir, "libGLEW.dylib").exists();
32633263
if (hasBundled) {
3264+
// Strip macOS quarantine attribute so Gatekeeper does not block the dylibs
3265+
try {
3266+
new ProcessBuilder("xattr", "-dr", "com.apple.quarantine", macLibsDir.getAbsolutePath())
3267+
.start().waitFor();
3268+
} catch (Exception ignored) {}
32643269
cmd.add("-L" + macLibsDir.getAbsolutePath());
32653270
cmd.add("-Wl,-rpath," + macLibsDir.getAbsolutePath());
32663271
cmd.add("-Wl,-rpath,@executable_path");

0 commit comments

Comments
 (0)