r297861 - Don't use MSVC Setup Api on MinGW.

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 16 08:23:18 PDT 2017


Should this be a compile-time thing? I thought in general we try to make
clang-built-with-msvc and clang-built-with-mingw behave roughly the same
except for a different default triple, i.e. maybe this should be keyed off
the triple at runtime instead of with a compile-time ifdef. Or do some of
the APIs the 2017 path calls not exist in mingw?

On Wed, Mar 15, 2017 at 1:09 PM, Zachary Turner via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> Author: zturner
> Date: Wed Mar 15 12:09:36 2017
> New Revision: 297861
>
> URL: http://llvm.org/viewvc/llvm-project?rev=297861&view=rev
> Log:
> Don't use MSVC Setup Api on MinGW.
>
> Modified:
>     cfe/trunk/lib/Driver/ToolChains/MSVC.cpp
>
> Modified: cfe/trunk/lib/Driver/ToolChains/MSVC.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/
> ToolChains/MSVC.cpp?rev=297861&r1=297860&r2=297861&view=diff
> ============================================================
> ==================
> --- cfe/trunk/lib/Driver/ToolChains/MSVC.cpp (original)
> +++ cfe/trunk/lib/Driver/ToolChains/MSVC.cpp Wed Mar 15 12:09:36 2017
> @@ -44,6 +44,11 @@
>      #define NOMINMAX
>    #endif
>    #include <windows.h>
> +#endif
> +
> +#ifdef _MSC_VER
> +// Don't support SetupApi on MinGW.
> +#define USE_MSVC_SETUP_API
>
>  // Make sure this comes before MSVCSetupApi.h
>  #include <comdef.h>
> @@ -170,7 +175,7 @@ static bool findVCToolChainViaEnvironmen
>  // longer listed in the registry.
>  static bool findVCToolChainViaSetupConfig(std::string &Path,
>                                            bool &IsVS2017OrNewer) {
> -#if !defined(USE_WIN32)
> +#if !defined(USE_MSVC_SETUP_API)
>    return false;
>  #else
>    // FIXME: This really should be done once in the top-level program's
> main
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170316/7fda71eb/attachment.html>


More information about the cfe-commits mailing list