diff --git a/windows/org.eclipse.cdt.msw.build/plugin.properties b/windows/org.eclipse.cdt.msw.build/plugin.properties index 272a006cae7..f4bbed266a6 100644 --- a/windows/org.eclipse.cdt.msw.build/plugin.properties +++ b/windows/org.eclipse.cdt.msw.build/plugin.properties @@ -14,3 +14,4 @@ config.debug=Debug config.release=Release MSVCOutputParser.name = MSVC Build Output Parser +ClangCLBuiltinSpecsDetector.name = Clang-cl Built-in Compiler Settings \ No newline at end of file diff --git a/windows/org.eclipse.cdt.msw.build/plugin.xml b/windows/org.eclipse.cdt.msw.build/plugin.xml index 1476eaa756e..c8e8d75b575 100644 --- a/windows/org.eclipse.cdt.msw.build/plugin.xml +++ b/windows/org.eclipse.cdt.msw.build/plugin.xml @@ -762,4 +762,16 @@ prefer-non-shared="true"> + + + + + + 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; + } +}