From 6f06e634c4a248e6335fc553d583d368480fc1d3 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Mon, 16 Oct 2017 15:06:37 -0400 Subject: [PATCH] Fix up handling of Qt build config defaults. Don't rely on default properties any more. Make sure we can handle the cases when the properties are null. Change-Id: I8b359891286118553399e7635d2ea4b7f147892a --- .../qt/core/build/QtBuildConfiguration.java | 45 ++++--------------- 1 file changed, 8 insertions(+), 37 deletions(-) diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/build/QtBuildConfiguration.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/build/QtBuildConfiguration.java index 3ef3b6983aa..7f6c38fa4a1 100644 --- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/build/QtBuildConfiguration.java +++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/build/QtBuildConfiguration.java @@ -144,6 +144,7 @@ public class QtBuildConfiguration extends CBuildConfiguration if (launchMode != null) { settings.put(LAUNCH_MODE, launchMode); } + try { settings.flush(); } catch (BackingStoreException e) { @@ -463,47 +464,17 @@ public class QtBuildConfiguration extends CBuildConfiguration } return buildCommand; } else { - return null; - } - - } - - @Override - public Map getDefaultProperties() { - Map defaults = super.getDefaultProperties(); - - String qmakeCommand = qtInstall.getQmakePath().toString(); - defaults.put(QMAKE_COMMAND, qmakeCommand); - - String qmakeArgs; - String launchMode = getLaunchMode(); - if (launchMode != null) { - switch (launchMode) { - case "run": //$NON-NLS-1$ - qmakeArgs = "CONFIG-=debug_and_release CONFIG+=release"; //$NON-NLS-1$ - break; - case "debug": //$NON-NLS-1$ - qmakeArgs = "CONFIG-=debug_and_release CONFIG+=debug"; //$NON-NLS-1$ - break; - default: - qmakeArgs = "CONFIG-=debug_and_release CONFIG+=launch_mode_" + launchMode; //$NON-NLS-1$ + Path command = findCommand("make"); //$NON-NLS-1$ + if (command == null) { + command = findCommand("mingw32-make"); //$NON-NLS-1$ } - } else { - qmakeArgs = "CONFIG+=debug_and_release CONFIG+=launch_modeall"; //$NON-NLS-1$ - } - defaults.put(QMAKE_ARGS, qmakeArgs); - String buildCommand = "make"; //$NON-NLS-1$ - if (findCommand(buildCommand) == null) { - buildCommand = "mingw32-make"; //$NON-NLS-1$ - if (findCommand(buildCommand) == null) { - // Neither was found, default to make - buildCommand = "make"; //$NON-NLS-1$ + if (command != null) { + return new String[] { command.toString() }; + } else { + return null; } } - defaults.put(BUILD_COMMAND, buildCommand); - - return defaults; } @Override