Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc-Andre Laperle2020-09-15 23:45:43 -0400
committerMarc-André Laperle2020-09-24 17:55:55 -0400
commit6a3e138431f4330cea0dd23c3a6f81da422a587e (patch)
treeb3cddffe160069d4afdd025d55551a24c10e7a63 /windows/org.eclipse.cdt.msw.build/src/org/eclipse
parentae3159f8098d824dcc0c69c76df40d3bff06978c (diff)
downloadorg.eclipse.cdt-6a3e138431f4330cea0dd23c3a6f81da422a587e.tar.gz
org.eclipse.cdt-6a3e138431f4330cea0dd23c3a6f81da422a587e.tar.xz
org.eclipse.cdt-6a3e138431f4330cea0dd23c3a6f81da422a587e.zip
Bug 567018 - Built-in language settings provider for Clang-cl
It is the same as GCC built-in provider but with tweaked parameters to pass to Clang driver. It has to be enabled by hand since there is no toolchain associated with it for now. Change-Id: I5455d04725b2ee4709844d32ee32d355d120d807 Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
Diffstat (limited to 'windows/org.eclipse.cdt.msw.build/src/org/eclipse')
-rw-r--r--windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/internal/msw/build/core/ClangClBuiltinSpecsDetector.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/internal/msw/build/core/ClangClBuiltinSpecsDetector.java b/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/internal/msw/build/core/ClangClBuiltinSpecsDetector.java
new file mode 100644
index 00000000000..da228061f6f
--- /dev/null
+++ b/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/internal/msw/build/core/ClangClBuiltinSpecsDetector.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Marc-Andre Laperle.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package org.eclipse.cdt.internal.msw.build.core;
+
+import org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector;
+
+/**
+ * Language settings provider to detect built-in compiler settings for the Clang-cl compiler.
+ */
+public class ClangClBuiltinSpecsDetector extends GCCBuiltinSpecsDetector {
+
+ // This ID is mostly used for the global provider case to get the compiler command from the toolchain
+ // which will be wrong here (cl instead of clang-cl), although less wrong than GCC. We would need a dedicated
+ // Clang-cl toolchain to make the global case work.
+ // But it will correctly display whether or not the associated toolchain (MSVC) is installed and supported, instead of checking GCC.
+ private static final String TOOLCHAIN_ID = "org.eclipse.cdt.msvc.toolchain.base"; //$NON-NLS-1$
+
+ @Override
+ public String getToolchainId() {
+ return TOOLCHAIN_ID;
+ }
+}

Back to the top