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@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@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits >
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits