Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/GCCToolChain.java3
-rw-r--r--build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java18
-rw-r--r--build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfigurationProvider.java10
3 files changed, 22 insertions, 9 deletions
diff --git a/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/GCCToolChain.java b/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/GCCToolChain.java
index 4665dda940e..1425a4f0da8 100644
--- a/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/GCCToolChain.java
+++ b/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/GCCToolChain.java
@@ -474,7 +474,8 @@ public class GCCToolChain extends PlatformObject implements IToolChain {
cppCommand = null;
if (cCommand.contains("gcc")) { //$NON-NLS-1$
cppCommand = cCommand.replace("gcc", "g++"); //$NON-NLS-1$ //$NON-NLS-2$
- commands = new String[] { cCommand, cppCommand };
+ // Also recognize c++ as an alias for g++
+ commands = new String[] { cCommand, cppCommand, cCommand.replace("gcc", "c++") }; //$NON-NLS-1$ //$NON-NLS-2$
} else if (cCommand.contains("clang")) { //$NON-NLS-1$
cppCommand = cCommand.replace("clang", "clang++"); //$NON-NLS-1$ //$NON-NLS-2$
commands = new String[] { cCommand, cppCommand };
diff --git a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java
index 0d9a9c06ac6..1308426d97d 100644
--- a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java
+++ b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java
@@ -58,6 +58,16 @@ public class CMakeBuildConfiguration extends CBuildConfiguration {
if (!pathStr.isEmpty()) {
Path path = Paths.get(pathStr);
toolChainFile = manager.getToolChainFile(path);
+ } else {
+ toolChainFile = manager.getToolChainFileFor(getToolChain());
+ if (toolChainFile != null) {
+ settings.put(TOOLCHAIN_FILE, toolChainFile.getPath().toString());
+ try {
+ settings.flush();
+ } catch (BackingStoreException e) {
+ Activator.log(e);
+ }
+ }
}
}
@@ -70,6 +80,10 @@ public class CMakeBuildConfiguration extends CBuildConfiguration {
super(config, name, toolChain, launchMode);
this.toolChainFile = toolChainFile;
+ saveToolChainFile();
+ }
+
+ private void saveToolChainFile() {
if (toolChainFile != null) {
Preferences settings = getSettings();
settings.put(TOOLCHAIN_FILE, toolChainFile.getPath().toString());
@@ -81,10 +95,6 @@ public class CMakeBuildConfiguration extends CBuildConfiguration {
}
}
- public ICMakeToolChainFile getToolChainFile() {
- return toolChainFile;
- }
-
@Override
public IProject[] build(int kind, Map<String, String> args, IConsole console, IProgressMonitor monitor)
throws CoreException {
diff --git a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfigurationProvider.java b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfigurationProvider.java
index 71916f5d22a..2ffd0864ed1 100644
--- a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfigurationProvider.java
+++ b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfigurationProvider.java
@@ -83,10 +83,12 @@ public class CMakeBuildConfigurationProvider implements ICBuildConfigurationProv
if (arch != null && !arch.isEmpty()) {
properties.put(IToolChain.ATTR_ARCH, arch);
}
- ICMakeToolChainFile file = null;
- Collection<ICMakeToolChainFile> files = manager.getToolChainFilesMatching(properties);
- if (!files.isEmpty()) {
- file = files.iterator().next();
+ ICMakeToolChainFile file = manager.getToolChainFileFor(toolChain);
+ if (file == null) {
+ Collection<ICMakeToolChainFile> files = manager.getToolChainFilesMatching(properties);
+ if (!files.isEmpty()) {
+ file = files.iterator().next();
+ }
}
// create config

Back to the top