summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrançois Godin2018-08-01 19:05:24 -0400
committerFrançois Godin2018-08-01 19:05:24 -0400
commit0b2053dcb20968508c1e48283582579eef23eefb (patch)
treee3e88db4cff046b43e02da90264a6e0398e926c4
parent02344726c8ea4d1c88dce63c808d5abb19d1600e (diff)
downloadorg.eclipse.cdt-0b2053dcb20968508c1e48283582579eef23eefb.tar.gz
org.eclipse.cdt-0b2053dcb20968508c1e48283582579eef23eefb.tar.xz
org.eclipse.cdt-0b2053dcb20968508c1e48283582579eef23eefb.zip
Bug 537118 - CMake and Meson integration now working on Windows.
- The commands are launched directly instead of using the shell (/bin/sh) which is not available on Windows. Change-Id: I5f8d99a04da1c860bcd37d138103a1bd4e501547 Signed-off-by: François Godin <copelnug@gmail.com>
-rw-r--r--build/org.eclipse.cdt.cmake.ui/src/org/eclipse/cdt/cmake/ui/properties/CMakePropertyPage.java12
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyPage.java14
2 files changed, 7 insertions, 19 deletions
diff --git a/build/org.eclipse.cdt.cmake.ui/src/org/eclipse/cdt/cmake/ui/properties/CMakePropertyPage.java b/build/org.eclipse.cdt.cmake.ui/src/org/eclipse/cdt/cmake/ui/properties/CMakePropertyPage.java
index 0a8b174de7..17f33686d6 100644
--- a/build/org.eclipse.cdt.cmake.ui/src/org/eclipse/cdt/cmake/ui/properties/CMakePropertyPage.java
+++ b/build/org.eclipse.cdt.cmake.ui/src/org/eclipse/cdt/cmake/ui/properties/CMakePropertyPage.java
@@ -92,7 +92,7 @@ public class CMakePropertyPage extends PropertyPage {
((ICBuildCommandLauncher)launcher).setBuildConfiguration(cconfig);
}
IPath buildPath = project.getLocation().append("build").append(((CBuildConfiguration)cconfig).getName());
- Process p = launcher.execute(new Path("/bin/sh"), new String[] { "-c", "cmake -LAH ."}, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Process p = launcher.execute(new Path("cmake"), new String[] { "-LAH", "."}, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
new String[0], buildPath, new NullProgressMonitor());
if (p != null) {
ByteArrayOutputStream stdout = new ByteArrayOutputStream();
@@ -144,7 +144,6 @@ public class CMakePropertyPage extends PropertyPage {
@Override
public boolean performOk() {
List<String> args = new ArrayList<>();
- args.add("cmake"); //$NON-NLS-1$
args.add("-LAH"); //$NON-NLS-1$
for (ICMakePropertyPageControl control : componentList) {
if (control.isValueChanged()) {
@@ -164,13 +163,8 @@ public class CMakePropertyPage extends PropertyPage {
if (launcher instanceof ICBuildCommandLauncher) {
((ICBuildCommandLauncher)launcher).setBuildConfiguration(buildConfig);
}
- StringBuilder b = new StringBuilder();
- for (String arg : args) {
- b.append(arg);
- b.append(" "); //$NON-NLS-1$
- }
- b.append(".");
- Process p = launcher.execute(new Path("/bin/sh"), new String[] { "-c", b.toString() }, new String[0], buildDir, new NullProgressMonitor()); //$NON-NLS-1$ //$NON-NLS-2$
+ args.add(".");
+ Process p = launcher.execute(new Path("cmake"), args.toArray(new String[0]), new String[0], buildDir, new NullProgressMonitor()); //$NON-NLS-1$
int rc = -1;
IConsole console = CCorePlugin.getDefault().getConsole();
console.start(project);
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyPage.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyPage.java
index 35cc5d9e31..a7ba446c88 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyPage.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/meson/ui/properties/MesonPropertyPage.java
@@ -90,7 +90,7 @@ public class MesonPropertyPage extends PropertyPage {
if (launcher instanceof ICBuildCommandLauncher) {
((ICBuildCommandLauncher)launcher).setBuildConfiguration(buildConfig);
}
- Process p = launcher.execute(new Path("/bin/sh"), new String[] { "-c", "meson configure " + buildDir}, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Process p = launcher.execute(new Path("meson"), new String[] { "configure", buildDir}, //$NON-NLS-1$ //$NON-NLS-2$
new String[0], sourceDir, new NullProgressMonitor());
if (p != null) {
ByteArrayOutputStream stdout = new ByteArrayOutputStream();
@@ -114,7 +114,7 @@ public class MesonPropertyPage extends PropertyPage {
if (launcher instanceof ICBuildCommandLauncher) {
((ICBuildCommandLauncher)launcher).setBuildConfiguration(buildConfig);
}
- Process p = launcher.execute(new Path("/bin/sh"), new String[] { "-c", "meson -h"}, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Process p = launcher.execute(new Path("meson"), new String[] { "-h"}, //$NON-NLS-1$ //$NON-NLS-2$
new String[0], sourceDir, new NullProgressMonitor());
if (p == null) {
return null;
@@ -240,7 +240,6 @@ public class MesonPropertyPage extends PropertyPage {
public boolean performOk() {
List<String> args = new ArrayList<>();
if (configured) {
- args.add("meson"); //$NON-NLS-1$
args.add("configure"); //$NON-NLS-1$
for (IMesonPropertyPageControl control : componentList) {
if (control.isValueChanged()) {
@@ -259,13 +258,8 @@ public class MesonPropertyPage extends PropertyPage {
if (launcher instanceof ICBuildCommandLauncher) {
((ICBuildCommandLauncher)launcher).setBuildConfiguration(buildConfig);
}
- StringBuilder b = new StringBuilder();
- for (String arg : args) {
- b.append(arg);
- b.append(" "); //$NON-NLS-1$
- }
- b.append(buildDir);
- Process p = launcher.execute(new Path("/bin/sh"), new String[] { "-c", b.toString() }, new String[0], sourceDir, new NullProgressMonitor()); //$NON-NLS-1$ //$NON-NLS-2$
+ args.add(buildDir);
+ Process p = launcher.execute(new Path("meson"), args.toArray(new String[0]), new String[0], sourceDir, new NullProgressMonitor()); //$NON-NLS-1$ //$NON-NLS-2$
int rc = -1;
IConsole console = CCorePlugin.getDefault().getConsole();
console.start(project);