Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Schaefer2017-11-08 17:49:00 +0000
committerDoug Schaefer2017-11-08 19:11:31 +0000
commit4ce1f1ca16b0013298c51a5311528ae21cdfd645 (patch)
treea5e815687a2cc711b511bab788fa6ec48d9018e7 /build/org.eclipse.cdt.build.gcc.core
parent2bc9836f68a8597e552d4d5b42e15d85c6944e81 (diff)
downloadorg.eclipse.cdt-4ce1f1ca16b0013298c51a5311528ae21cdfd645.tar.gz
org.eclipse.cdt-4ce1f1ca16b0013298c51a5311528ae21cdfd645.tar.xz
org.eclipse.cdt-4ce1f1ca16b0013298c51a5311528ae21cdfd645.zip
Add Makefile Projects to collection of core build project types.
Reuses the old makeNature. Reuses the StandardBuildConfiguration. Generates a pretty simple project for now. Also handles the case where you don't want to generate anything, just create an empty or on an existing source tree. Change-Id: I2f3cddc85d55792a2c537e37d4bc236a3073d930
Diffstat (limited to 'build/org.eclipse.cdt.build.gcc.core')
-rw-r--r--build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/GCCToolChain.java38
1 files changed, 21 insertions, 17 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 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;
}
}

Back to the top