Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorjantje2020-06-13 17:14:34 +0000
committerJonah Graham2020-06-13 23:40:08 +0000
commit3516a46a92f5e7a960f6e8618f2adf0d93c271e4 (patch)
treea6ccc75db14ca1fa8a68f0c4e521f18b885b02ef /core
parent9867126d6f36fd59b35528d6019355fabcf51423 (diff)
downloadorg.eclipse.cdt-3516a46a92f5e7a960f6e8618f2adf0d93c271e4.tar.gz
org.eclipse.cdt-3516a46a92f5e7a960f6e8618f2adf0d93c271e4.tar.xz
org.eclipse.cdt-3516a46a92f5e7a960f6e8618f2adf0d93c271e4.zip
Bug 564123: use EnvironmentReader in core build
CBuildConfiguration.findCommand read environments like EnvironmentReader Change-Id: Iedd474c647a0c22fecdd525bf50927159d138031 Signed-off-by: jantje <eclipse@baeyens.it>
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java
index 5c25e239162..7fde565b580 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java
@@ -32,6 +32,7 @@ import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
+import java.util.Properties;
import java.util.Map.Entry;
import java.util.Set;
@@ -66,6 +67,7 @@ import org.eclipse.cdt.internal.core.model.BinaryRunner;
import org.eclipse.cdt.internal.core.model.CModelManager;
import org.eclipse.cdt.internal.core.parser.ParserSettings2;
import org.eclipse.cdt.utils.CommandLineUtil;
+import org.eclipse.cdt.utils.spawner.EnvironmentReader;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.resources.IBuildConfiguration;
import org.eclipse.core.resources.IContainer;
@@ -434,16 +436,18 @@ public abstract class CBuildConfiguration extends PlatformObject implements ICBu
if (cmdPath.isAbsolute()) {
return cmdPath;
}
+ Properties environmentVariables = EnvironmentReader.getEnvVars();
+ Map<String, String> env = new HashMap<>();
+ for (String key : environmentVariables.stringPropertyNames()) {
+ String value = environmentVariables.getProperty(key);
+ env.put(key, value);
+ }
- Map<String, String> env = new HashMap<>(System.getenv());
setBuildEnvironment(env);
String pathStr = env.get("PATH"); //$NON-NLS-1$
if (pathStr == null) {
- pathStr = env.get("Path"); // for Windows //$NON-NLS-1$
- if (pathStr == null) {
- return null; // no idea
- }
+ return null; // no idea
}
String[] path = pathStr.split(File.pathSeparator);
for (String dir : path) {

Back to the top