? patch.txt ? patchVC11.txt Index: GCC_XML/GXFront/gxConfiguration.cxx =================================================================== RCS file: /cvsroot/GCC_XML/gccxml/GCC_XML/GXFront/gxConfiguration.cxx,v retrieving revision 1.73 diff -u -r1.73 gxConfiguration.cxx --- GCC_XML/GXFront/gxConfiguration.cxx 4 Apr 2011 13:08:53 -0000 1.73 +++ GCC_XML/GXFront/gxConfiguration.cxx 18 Dec 2011 16:43:18 -0000 @@ -60,6 +60,11 @@ const char* gxConfigurationVc10sdkRegistry = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.0A;InstallationFolder"; +const char* gxConfigurationVc11Registry = +"HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\11.0\\Setup\\VC;ProductDir"; +const char* gxConfigurationVc11sdkRegistry = +"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0A;InstallationFolder"; + //---------------------------------------------------------------------------- gxConfiguration::gxConfiguration() { @@ -1109,9 +1114,13 @@ { return this->FindFlagsMSVC10(); } + else if(compilerName == "msvc11") + { + return this->FindFlagsMSVC11(); + } else if(compilerName == "cl") { - // We must decide if this is MSVC 6, 7, 7.1, 8, 9, or 10. + // We must decide if this is MSVC 6, 7, 7.1, 8, 9, 10 or 11. std::string loc; bool have6 = gxSystemTools::ReadRegistryValue(gxConfigurationVc6Registry, loc); @@ -1127,6 +1136,8 @@ bool have10 = gxSystemTools::ReadRegistryValue(gxConfigurationVc10Registry, loc); + bool have11 = gxSystemTools::ReadRegistryValue(gxConfigurationVc11Registry, loc); + // Look for a VS8 that is not the beta release. bool have8 = false; if(gxSystemTools::ReadRegistryValue(gxConfigurationVc8Registry, loc)) @@ -1147,35 +1158,39 @@ } // See if only one is installed. - if(have6 && !have7 && !have71 && !have8 && !have8ex && !have9 && !have10) + if(have6 && !have7 && !have71 && !have8 && !have8ex && !have9 && !have10 && !have11) { return this->FindFlagsMSVC6(); } - else if(!have6 && have7 && !have71 && !have8 && !have8ex && !have9 && !have10) + else if(!have6 && have7 && !have71 && !have8 && !have8ex && !have9 && !have10 && !have11) { return this->FindFlagsMSVC7(); } - else if(!have6 && !have7 && have71 && !have8 && !have8ex && !have9 && !have10) + else if(!have6 && !have7 && have71 && !have8 && !have8ex && !have9 && !have10 && !have11) { return this->FindFlagsMSVC71(); } - else if(!have6 && !have7 && !have71 && have8 && !have8ex && !have9 && !have10) + else if(!have6 && !have7 && !have71 && have8 && !have8ex && !have9 && !have10 && !have11) { return this->FindFlagsMSVC8(); } - else if(!have6 && !have7 && !have71 && !have8 && have8ex && !have9 && !have10) + else if(!have6 && !have7 && !have71 && !have8 && have8ex && !have9 && !have10 && !have11) { return this->FindFlagsMSVC8ex(); } - else if(!have6 && !have7 && !have71 && !have8 && !have8ex && have9 && !have10) + else if(!have6 && !have7 && !have71 && !have8 && !have8ex && have9 && !have10 && !have11) { return this->FindFlagsMSVC9(); } - else if(!have6 && !have7 && !have71 && !have8 && !have8ex && !have9 && have10) + else if(!have6 && !have7 && !have71 && !have8 && !have8ex && !have9 && have10 && !have11) + { + return this->FindFlagsMSVC10(); + } + else if(!have6 && !have7 && !have71 && !have8 && !have8ex && !have9 && !have10 && have11) { return this->FindFlagsMSVC10(); } - else if(have6 || have7 || have71 || have8 || have8ex || have9 || have10) + else if(have6 || have7 || have71 || have8 || have8ex || have9 || have10 || have11) { // Find available support directories. bool support6 = have6 && this->FindData("Vc6"); @@ -1185,31 +1200,31 @@ bool support8ex = have8ex && this->FindData("Vc8ex"); bool support9 = have9 && this->FindData("Vc9"); bool support10 = have10 && this->FindData("Vc10"); - + bool support11 = have11 && this->FindData("Vc11"); // Have more than one. See if only one has the support // directory available. if(support6 && !support7 && !support71 && !support8 && - !support8ex && !support9 && !support10) + !support8ex && !support9 && !support10 && !support11) { return this->FindFlagsMSVC6(); } else if(!support6 && support7 && !support71 && !support8 && - !support8ex && !support9 && !support10) + !support8ex && !support9 && !support10 && !support11) { return this->FindFlagsMSVC7(); } else if(!support6 && !support7 && support71 && !support8 && - !support8ex && !support9 && !support10) + !support8ex && !support9 && !support10 && !support11) { return this->FindFlagsMSVC71(); } else if(!support6 && !support7 && !support71 && support8 && - !support8ex && !support9 && !support10) + !support8ex && !support9 && !support10 && !support11) { return this->FindFlagsMSVC8(); } else if(!support6 && !support7 && !support71 && !support8 && - support8ex && !support9 && !support10) + support8ex && !support9 && !support10 && !support11) { return this->FindFlagsMSVC8ex(); } @@ -1224,11 +1239,16 @@ return this->FindFlagsMSVC10(); } else if(!support6 && !support7 && !support71 && !support8 && - !support8ex && !support9 && !support10) + !support8ex && !support9 && !support10 && support11) + { + return this->FindFlagsMSVC11(); + } + else if(!support6 && !support7 && !support71 && !support8 && + !support8ex && !support9 && !support10 && !support11) { std::cerr << "Compiler \"" << m_GCCXML_COMPILER << "\" is not supported by GCC_XML because none of \n" - << "the Vc6, Vc7, Vc71, Vc8, Vc8ex, Vc9, Vc9ex or Vc10 " + << "the Vc6, Vc7, Vc71, Vc8, Vc8ex, Vc9, Vc9ex, Vc10 or Vc11 " << "support directories exists.\n"; return false; } @@ -1297,6 +1317,10 @@ { return this->FindFlagsMSVC10(); } + else if(output.find("Compiler Version 17.") != std::string::npos) + { + return this->FindFlagsMSVC11(); + } } // Couldn't tell by running the compiler. } @@ -1304,9 +1328,9 @@ // was used to build this executable. const char* const clText = "Compiler \"cl\" specified, but more than one of " - "MSVC 6, 7, 7.1, 8, 9, and 10 are installed.\n" + "MSVC 6, 7, 7.1, 8, 9, 10 and 11 are installed.\n" "Please specify \"msvc6\", \"msvc7\", \"msvc71\", \"msvc8\", " - "\"msvc8ex\", \"msvc9\", or \"msvc10\" for " + "\"msvc8ex\", \"msvc9\", \"msvc10\", or \"msvc11\" for " "the GCCXML_COMPILER setting.\n"; #if defined(_MSC_VER) && ((_MSC_VER >= 1200) && (_MSC_VER < 1300)) std::cerr << "Warning:\n" << clText @@ -1349,6 +1373,11 @@ << "Using MSVC 10 because it was used to build GCC-XML.\n" << "\n"; return this->FindFlagsMSVC10(); +#elif defined(_MSC_VER) && ((_MSC_VER >= 1700) && (_MSC_VER < 1800)) + std::cerr << "Warning:\n" << clText + << "Using MSVC 11 because it was used to build GCC-XML.\n" + << "\n"; + return this->FindFlagsMSVC11(); #else // Give up. The user must specify one. std::cerr << clText; @@ -1359,7 +1388,7 @@ { std::cerr << "Compiler \"" << m_GCCXML_COMPILER << "\" is not supported by GCC_XML because " - << "none of MSVC 6, 7, 7.1, 8, 9 or 10 is installed.\n"; + << "none of MSVC 6, 7, 7.1, 8, 9, 10 or 11 is installed.\n"; return false; } } @@ -2549,6 +2578,77 @@ return true; } +bool gxConfiguration::FindFlagsMSVC11() +{ + // The registry key to use when attempting to automatically find the + // MSVC include files. + std::string msvcPath; + if(!gxSystemTools::ReadRegistryValue(gxConfigurationVc11Registry, msvcPath)) + { + std::cerr << "Error finding MSVC 11 from registry.\n"; + return false; + } + std::string psdkPath; + if(!gxSystemTools::ReadRegistryValue(gxConfigurationVc11sdkRegistry, psdkPath)) + { + std::cerr << "Error finding MSVC 11 Platform SDK from registry.\n"; + return false; + } + std::string msvcPath1 = msvcPath+"/Include"; + std::string msvcPath2 = psdkPath+"/Include"; + msvcPath1 = gxSystemTools::CollapseDirectory(msvcPath1.c_str()); + msvcPath2 = gxSystemTools::CollapseDirectory(msvcPath2.c_str()); + std::string vcIncludePath1; + std::string vcIncludePath2; + if(!this->FindData("Vc11/Include", vcIncludePath1) || + !this->FindData("Vc11/PlatformSDK", vcIncludePath2)) + { + return false; + } + + m_GCCXML_FLAGS = + "-U__STDC__ -U__STDC_HOSTED__ " + "-D__stdcall=__attribute__((__stdcall__)) " + "-D__cdecl=__attribute__((__cdecl__)) " + "-D__fastcall=__attribute__((__fastcall__)) " + "-D__thiscall=__attribute__((__thiscall__)) " + "-D_stdcall=__attribute__((__stdcall__)) " + "-D_cdecl=__attribute__((__cdecl__)) " + "-D_fastcall=__attribute__((__fastcall__)) " + "-D_thiscall=__attribute__((__thiscall__)) " + "-D__declspec(x)=__attribute__((x)) -D__pragma(x)= " + "-D__cplusplus -D_inline=inline -D__forceinline=__inline " + "-D_MSC_VER=1600 -D_MSC_EXTENSIONS -D_WIN32 " + "-D_M_IX86 " + "-D_WCHAR_T_DEFINED -DPASCAL= -DRPC_ENTRY= -DSHSTDAPI=HRESULT " + "-D_INTEGRAL_MAX_BITS=64 " + "-D_HAS_CPP0X=0 " + "-D__uuidof(x)=IID() -DSHSTDAPI_(x)=x " + "-D__w64= " + "-D__int8=char " + "-D__int16=short " + "-D__int32=int " + "-D__int64=\"long long\" " + "-D__ptr64= " + "-DSTRSAFE_NO_DEPRECATE " + "-D_CRT_FAR_MAPPINGS_NO_DEPRECATE " + "-D_CRT_MANAGED_FP_NO_DEPRECATE " + "-D_CRT_MANAGED_HEAP_NO_DEPRECATE " + "-D_CRT_NONSTDC_NO_DEPRECATE " + "-D_CRT_OBSOLETE_NO_DEPRECATE " + "-D_CRT_SECURE_NO_DEPRECATE " + "-D_CRT_SECURE_NO_DEPRECATE_GLOBALS " + "-D_CRT_VCCLRIT_NO_DEPRECATE " + "-D_SCL_SECURE_NO_DEPRECATE " + "-D_WINDOWS_SECURE_NO_DEPRECATE " + "-iwrapper\""+vcIncludePath1+"\" " + "-iwrapper\""+vcIncludePath2+"\" " + "-I\""+msvcPath1+"\" " + "-I\""+msvcPath2+"\" "; + return true; +} + + //---------------------------------------------------------------------------- bool gxConfiguration::FindFlagsBCC55(const char* inBcc32) { Index: GCC_XML/GXFront/gxConfiguration.h =================================================================== RCS file: /cvsroot/GCC_XML/gccxml/GCC_XML/GXFront/gxConfiguration.h,v retrieving revision 1.19 diff -u -r1.19 gxConfiguration.h --- GCC_XML/GXFront/gxConfiguration.h 18 Nov 2010 19:45:59 -0000 1.19 +++ GCC_XML/GXFront/gxConfiguration.h 18 Dec 2011 16:21:07 -0000 @@ -164,6 +164,7 @@ bool FindFlagsMSVC8ex(); bool FindFlagsMSVC9(); bool FindFlagsMSVC10(); + bool FindFlagsMSVC11(); bool FindFlagsBCC55(const char* inBcc32); };