Skip to content

Commit 0efd92a

Browse files
committed
macOS: always use Xcode CLT for compiler, cleaner UX
1 parent a4e99da commit 0efd92a

2 files changed

Lines changed: 12 additions & 33 deletions

File tree

mode/CppMode.jar

-178 Bytes
Binary file not shown.

src/java/InstallWizard.java

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -503,40 +503,19 @@ private boolean runMac(java.util.List<String> missing) {
503503

504504
// ── Step 1: compiler ────────────────────────────────────────────────
505505
if (needsCompiler) {
506-
if (brewExe != null) {
507-
// Homebrew present: install gcc fully in-app, no GUI popup needed.
508-
setStep("Installing: g++ (via Homebrew)");
509-
appendLog("Installing gcc via Homebrew...");
510-
try {
511-
ProcessBuilder pb = new ProcessBuilder(brewExe, "install", "gcc");
512-
pb.redirectErrorStream(true);
513-
Process proc = pb.start();
514-
streamToLog(proc);
515-
int code = proc.waitFor();
516-
if (cancelled.get()) return;
517-
if (code != 0) { finishDialog(false, "Failed to install gcc — see log above."); return; }
518-
} catch (Exception e) {
519-
finishDialog(false, "Couldn't run Homebrew: " + e.getMessage()); return;
520-
}
521-
} else {
522-
// No Homebrew: fall back to Xcode Command Line Tools GUI.
523-
setStep("Installing: g++ (Xcode Command Line Tools)");
524-
appendLog("Opening the Xcode Command Line Tools installer...");
525-
appendLog("Please complete the popup window, then wait here.");
526-
try { new ProcessBuilder("xcode-select", "--install").start(); }
527-
catch (Exception e) { finishDialog(false, "Couldn't start Xcode CLT installer."); return; }
528-
boolean installed = false;
529-
for (int i = 0; i < 180; i++) {
530-
if (cancelled.get()) return;
531-
try { Thread.sleep(5000); } catch (InterruptedException ignored) {}
532-
appendLog("Waiting for Xcode CLT... (" + ((i+1)*5) + "s)");
533-
if (commandExists("xcrun", "-find", "g++")) { installed = true; break; }
534-
}
535-
if (!installed) {
536-
finishDialog(false, "Xcode CLT not detected — finish the install and try again.");
537-
return;
538-
}
506+
setStep("Installing: Xcode Command Line Tools");
507+
appendLog("Opening the Xcode Command Line Tools installer...");
508+
appendLog("Please click Install in the popup window, then wait here.");
509+
try { new ProcessBuilder("xcode-select", "--install").start(); }
510+
catch (Exception e) { finishDialog(false, "Couldn't launch Xcode CLT installer."); return; }
511+
boolean installed = false;
512+
for (int i = 0; i < 180; i++) {
513+
if (cancelled.get()) return;
514+
try { Thread.sleep(5000); } catch (InterruptedException ignored) {}
515+
appendLog("Waiting for installation... (" + ((i+1)*5) + "s)");
516+
if (commandExists("xcrun", "-find", "g++")) { installed = true; break; }
539517
}
518+
if (!installed) { finishDialog(false, "Xcode CLT not detected — finish the install and try again."); return; }
540519
}
541520
if (cancelled.get()) return;
542521
if (missingLibs.isEmpty()) { finishDialog(true, "Setup complete."); return; }

0 commit comments

Comments
 (0)