Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2018-02-14 12:37:55 -0500
committerJeff Johnston2018-02-14 13:09:18 -0500
commite31e23bb4efc0b9bcbd02d66a40150d95e5fa175 (patch)
tree1ed5e410776ecb30b748461a3399ef989d9dbf59 /build/org.eclipse.cdt.meson.core
parent34050632032879e417d8f16c1fc55d088bfebf8b (diff)
downloadorg.eclipse.cdt-e31e23bb4efc0b9bcbd02d66a40150d95e5fa175.tar.gz
org.eclipse.cdt-e31e23bb4efc0b9bcbd02d66a40150d95e5fa175.tar.xz
org.eclipse.cdt-e31e23bb4efc0b9bcbd02d66a40150d95e5fa175.zip
Apply CMake changes from Bug 530673 to Meson
- Fix issue with Meson and changing toolchains since Meson is based on CMake plug-ins - Cleaned up add and remove of toolchain files and handling of when a toolchain changes for a config Change-Id: I147a30454c69e3d8d86fc50c561a1667ddfb5df3
Diffstat (limited to 'build/org.eclipse.cdt.meson.core')
-rw-r--r--build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonBuildConfiguration.java7
-rw-r--r--build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonBuildConfigurationProvider.java17
-rw-r--r--build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonToolChainManager.java2
-rw-r--r--build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/meson/core/IMesonToolChainListener.java2
4 files changed, 23 insertions, 5 deletions
diff --git a/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonBuildConfiguration.java b/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonBuildConfiguration.java
index 5f2a65b487..7be7a1bdaf 100644
--- a/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonBuildConfiguration.java
+++ b/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonBuildConfiguration.java
@@ -18,6 +18,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.CommandLauncherManager;
import org.eclipse.cdt.core.ConsoleOutputStream;
import org.eclipse.cdt.core.ErrorParserManager;
@@ -26,6 +27,7 @@ import org.eclipse.cdt.core.build.CBuildConfiguration;
import org.eclipse.cdt.core.build.ICBuildCommandLauncher;
import org.eclipse.cdt.core.build.IToolChain;
import org.eclipse.cdt.core.model.ICModelMarker;
+import org.eclipse.cdt.core.parser.IExtendedScannerInfo;
import org.eclipse.cdt.core.resources.IConsole;
import org.eclipse.cdt.meson.core.Activator;
import org.eclipse.cdt.meson.core.IMesonConstants;
@@ -91,6 +93,10 @@ public class MesonBuildConfiguration extends CBuildConfiguration {
}
}
+ public IMesonToolChainFile getToolChainFile() {
+ return toolChainFile;
+ }
+
private boolean isLocal() throws CoreException {
IToolChain toolchain = getToolChain();
return Platform.getOS().equals(toolchain.getProperty(IToolChain.ATTR_OS))
@@ -315,5 +321,4 @@ public class MesonBuildConfiguration extends CBuildConfiguration {
}
-
}
diff --git a/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonBuildConfigurationProvider.java b/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonBuildConfigurationProvider.java
index dbe4b455f4..c321a73a8b 100644
--- a/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonBuildConfigurationProvider.java
+++ b/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonBuildConfigurationProvider.java
@@ -41,7 +41,7 @@ public class MesonBuildConfigurationProvider implements ICBuildConfigurationProv
}
@Override
- public ICBuildConfiguration getCBuildConfiguration(IBuildConfiguration config, String name) throws CoreException {
+ public synchronized ICBuildConfiguration getCBuildConfiguration(IBuildConfiguration config, String name) throws CoreException {
if (config.getName().equals(IBuildConfiguration.DEFAULT_CONFIG_NAME)) {
IToolChain toolChain = null;
@@ -69,7 +69,19 @@ public class MesonBuildConfigurationProvider implements ICBuildConfigurationProv
// No valid combinations
return null;
}
- return new MesonBuildConfiguration(config, name);
+ MesonBuildConfiguration mesonConfig = new MesonBuildConfiguration(config, name);
+ IMesonToolChainFile tcFile = mesonConfig.getToolChainFile();
+ IToolChain toolChain = mesonConfig.getToolChain();
+ if (toolChain == null || tcFile == null) {
+ // config not complete?
+ return null;
+ }
+ if (!toolChain.equals(tcFile.getToolChain())) {
+ // toolchain changed
+ return new MesonBuildConfiguration(config, name, tcFile.getToolChain(), tcFile,
+ mesonConfig.getLaunchMode());
+ }
+ return mesonConfig;
}
@Override
@@ -90,6 +102,7 @@ public class MesonBuildConfigurationProvider implements ICBuildConfigurationProv
Collection<IMesonToolChainFile> files = manager.getToolChainFilesMatching(properties);
if (!files.isEmpty()) {
file = files.iterator().next();
+ toolChain = file.getToolChain();
}
}
diff --git a/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonToolChainManager.java b/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonToolChainManager.java
index 73b6b5e275..e7c7ade267 100644
--- a/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonToolChainManager.java
+++ b/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonToolChainManager.java
@@ -215,7 +215,7 @@ public class MesonToolChainManager implements IMesonToolChainManager {
SafeRunner.run(new ISafeRunnable() {
@Override
public void run() throws Exception {
- listener.handleCMakeToolChainEvent(event);
+ listener.handleMesonToolChainEvent(event);
}
@Override
diff --git a/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/meson/core/IMesonToolChainListener.java b/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/meson/core/IMesonToolChainListener.java
index 6e1cda8e95..283d9449b2 100644
--- a/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/meson/core/IMesonToolChainListener.java
+++ b/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/meson/core/IMesonToolChainListener.java
@@ -14,6 +14,6 @@ package org.eclipse.cdt.meson.core;
*/
public interface IMesonToolChainListener {
- void handleCMakeToolChainEvent(MesonToolChainEvent event);
+ void handleMesonToolChainEvent(MesonToolChainEvent event);
}

Back to the top