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 1b61d1a7b14..c922c4e32c2 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 @@ -288,11 +288,11 @@ public class GCCToolChain extends PlatformObject implements IToolChain { // Change source file to a tmp file (needs to be empty) Path tmpFile = null; for (int i = 1; i < commandLine.size(); ++i) { - if (!commandLine.get(i).startsWith("-")) { //$NON-NLS-1$ - // TODO optimize by dealing with multi arg options like -o + String arg = commandLine.get(i); + if (!arg.startsWith("-")) { //$NON-NLS-1$ Path filePath; try { - filePath = buildDirectory.resolve(commandLine.get(i)); + filePath = buildDirectory.resolve(commandLine.get(i)).normalize(); } catch (InvalidPathException e) { continue; } @@ -312,6 +312,10 @@ public class GCCToolChain extends PlatformObject implements IToolChain { tmpFile = Files.createTempFile(parentPath, ".sc", extension); //$NON-NLS-1$ commandLine.set(i, tmpFile.toString()); } + } else if (arg.equals("-o")) { //$NON-NLS-1$ + // skip over the next arg + // TODO handle other args like this + i++; } } if (tmpFile == null) { @@ -486,7 +490,7 @@ public class GCCToolChain extends PlatformObject implements IToolChain { if (cCommand.contains("gcc")) { //$NON-NLS-1$ cppCommand = cCommand.replace("gcc", "g++"); //$NON-NLS-1$ //$NON-NLS-2$ // Also recognize c++ as an alias for g++ - commands = new String[] { cCommand, cppCommand, cCommand.replace("gcc", "c++") }; //$NON-NLS-1$ //$NON-NLS-2$ + commands = new String[] { cCommand, cppCommand, cCommand.replace("gcc", "c++"), "cc", "c++" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ } else if (cCommand.contains("clang")) { //$NON-NLS-1$ cppCommand = cCommand.replace("clang", "clang++"); //$NON-NLS-1$ //$NON-NLS-2$ commands = new String[] { cCommand, cppCommand }; @@ -529,21 +533,21 @@ public class GCCToolChain extends PlatformObject implements IToolChain { // ran into an option, we're done. break; } - Path srcPath = Paths.get(arg); - URI uri; - if (srcPath.isAbsolute()) { - uri = srcPath.toUri(); - } else { - try { - uri = buildDirectoryURI.resolve(arg); - } catch (IllegalArgumentException e) { - // Bad URI - continue; + try { + Path srcPath = Paths.get(arg); + URI uri; + if (srcPath.isAbsolute()) { + uri = srcPath.toUri(); + } else { + uri = Paths.get(buildDirectoryURI).resolve(srcPath).toUri().normalize(); } - } - for (IFile resource : root.findFilesForLocationURI(uri)) { - resources.add(resource); + for (IFile resource : root.findFilesForLocationURI(uri)) { + resources.add(resource); + } + } catch (IllegalArgumentException e) { + // Bad URI + continue; } } diff --git a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/CMakeProjectGenerator.java b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/CMakeProjectGenerator.java index de95869895d..45de6077e6a 100644 --- a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/CMakeProjectGenerator.java +++ b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/CMakeProjectGenerator.java @@ -58,7 +58,9 @@ public class CMakeProjectGenerator extends FMProjectGenerator { List entries = new ArrayList<>(); IProject project = getProject(); - // Create the source folders + // Create the source and output folders + IFolder buildFolder = getProject().getFolder("build"); //$NON-NLS-1$ + TemplateManifest manifest = getManifest(); if (manifest != null) { List srcRoots = getManifest().getSrcRoots(); @@ -69,14 +71,15 @@ public class CMakeProjectGenerator extends FMProjectGenerator { sourceFolder.create(true, true, monitor); } - entries.add(CoreModel.newSourceEntry(sourceFolder.getFullPath())); + entries.add(CoreModel.newSourceEntry(sourceFolder.getFullPath(), + new IPath[] { buildFolder.getFullPath() })); } } else { entries.add(CoreModel.newSourceEntry(getProject().getFullPath())); } } - entries.add(CoreModel.newOutputEntry(getProject().getFolder("build").getFullPath(), //$NON-NLS-1$ + entries.add(CoreModel.newOutputEntry(buildFolder.getFullPath(), // $NON-NLS-1$ new IPath[] { new Path("**/CMakeFiles/**") })); //$NON-NLS-1$ CoreModel.getDefault().create(project).setRawPathEntries(entries.toArray(new IPathEntry[entries.size()]), monitor); diff --git a/build/org.eclipse.cdt.core.autotools.ui/icons/cdt_logo_48.png b/build/org.eclipse.cdt.core.autotools.ui/icons/cdt_logo_48.png new file mode 100644 index 00000000000..4f2aecee517 Binary files /dev/null and b/build/org.eclipse.cdt.core.autotools.ui/icons/cdt_logo_48.png differ diff --git a/build/org.eclipse.cdt.core.autotools.ui/plugin.xml b/build/org.eclipse.cdt.core.autotools.ui/plugin.xml index e4abf4678a7..0437944c565 100644 --- a/build/org.eclipse.cdt.core.autotools.ui/plugin.xml +++ b/build/org.eclipse.cdt.core.autotools.ui/plugin.xml @@ -4,6 +4,7 @@