mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 22:22:11 +02:00
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>
(cherry picked from commit 0b2053dcb2
)
This commit is contained in:
parent
35a590e00b
commit
3603986d0b
2 changed files with 7 additions and 19 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue