Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2019-10-02 01:47:06 +0000
committerJeff Johnston2019-10-03 19:19:19 +0000
commit232e3d71536134a8fe722f133a8af7d785345790 (patch)
treecddfa18138764630981d5d837f0d5eb7ded941af
parentb52b03a9bc25469d062a19fbf734efd8f369c058 (diff)
downloadorg.eclipse.cdt-232e3d71536134a8fe722f133a8af7d785345790.tar.gz
org.eclipse.cdt-232e3d71536134a8fe722f133a8af7d785345790.tar.xz
org.eclipse.cdt-232e3d71536134a8fe722f133a8af7d785345790.zip
Bug 551089 - Builds with libraries having spaces in the name fail
- add new checkIfQuotedOption() method to GnuMakefileGenerator - have ensurePathIsGNUMakeTargetRuleCompatibleSyntax() look to see if the path is actually an option with path in which case if it is quoted, do not try to escape white space Change-Id: I67a286962ba67acb75d1f8c29cac47069ab07353
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java24
1 files changed, 23 insertions, 1 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java
index b75bdcfea1..6e081c3e0e 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java
@@ -38,6 +38,8 @@ import java.util.List;
import java.util.Map.Entry;
import java.util.Set;
import java.util.Vector;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.settings.model.CSourceEntry;
@@ -111,6 +113,9 @@ import org.eclipse.core.runtime.SubProgressMonitor;
public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
private static final IPath DOT_SLASH_PATH = new Path("./"); //$NON-NLS-1$
+ private Pattern doubleQuotedOption = Pattern.compile("--?[a-zA-Z]+.*?\\\".*?\\\".*"); //$NON-NLS-1$
+ private Pattern singleQuotedOption = Pattern.compile("--?[a-zA-Z]+.*?'.*?'.*"); //$NON-NLS-1$
+
/**
* This class walks the delta supplied by the build system to determine
* what resources have been changed. The logic is very simple. If a
@@ -3482,6 +3487,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
String nextToken = tokenIter.next();
token += WHITESPACE + nextToken;
if (!nextToken.endsWith("\\")) { //$NON-NLS-1$
+ //$NON-NLS-1$
break;
}
}
@@ -4478,7 +4484,23 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
*/
/* see https://bugs.eclipse.org/bugs/show_bug.cgi?id=129782 */
public String ensurePathIsGNUMakeTargetRuleCompatibleSyntax(String path) {
- return escapeWhitespaces(ensureUnquoted(path));
+ boolean isQuotedOption = false;
+ if (path.startsWith("-")) { //$NON-NLS-1$
+ isQuotedOption = checkIfQuotedOption(path);
+ }
+ if (!isQuotedOption)
+ return escapeWhitespaces(ensureUnquoted(path));
+ return path;
+ }
+
+ private boolean checkIfQuotedOption(String path) {
+ Matcher m1 = doubleQuotedOption.matcher(path);
+ if (m1.matches())
+ return true;
+ Matcher m2 = singleQuotedOption.matcher(path);
+ if (m2.matches())
+ return true;
+ return false;
}
/**

Back to the top