diff options
author | Joerg Bornemann <joerg.bornemann@nokia.com> | 2010-08-05 15:26:07 (GMT) |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@nokia.com> | 2010-08-10 08:53:03 (GMT) |
commit | 88002eb433150615bc2b171d3642bca6a18c9916 (patch) | |
tree | 263eb0267e5d7adede8e9f23c5631998432eb7f0 /qmake | |
parent | 79c4e65945b4741deed948c0c8e8d80818f0fbfb (diff) | |
download | Qt-88002eb433150615bc2b171d3642bca6a18c9916.zip Qt-88002eb433150615bc2b171d3642bca6a18c9916.tar.gz Qt-88002eb433150615bc2b171d3642bca6a18c9916.tar.bz2 |
qmake: duplicated code removed from msbuild_objectmodel.cpp
Rubber-stamped-by: ossi
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/generators/win32/msbuild_objectmodel.cpp | 2612 | ||||
-rw-r--r-- | qmake/generators/win32/msbuild_objectmodel.h | 562 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_objectmodel.cpp | 350 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_objectmodel.h | 66 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_vcxproj.cpp | 103 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_vcxproj.h | 5 |
6 files changed, 1060 insertions, 2638 deletions
diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index 1a65a04..c9ba248 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -102,7 +102,6 @@ const char _DisableLanguageExtensions[] = "DisableLanguageExtensions"; const char _DisableSpecificWarnings[] = "DisableSpecificWarnings"; const char _DisplayLibrary[] = "DisplayLibrary"; const char _DLLDataFileName[] = "DLLDataFileName"; -const char _Driver[] = "Driver"; const char _EmbedManagedResourceFile[] = "EmbedManagedResourceFile"; const char _EnableCOMDATFolding[] = "EnableCOMDATFolding"; const char _EnableUAC[] = "EnableUAC"; @@ -121,11 +120,9 @@ const char _ExceptionHandling[] = "ExceptionHandling"; const char _ExpandAttributedSource[] = "ExpandAttributedSource"; const char _ExportNamedFunctions[] = "ExportNamedFunctions"; const char _FavorSizeOrSpeed[] = "FavorSizeOrSpeed"; -const char _FixedBaseAddress[] = "FixedBaseAddress"; const char _FloatingPointModel[] = "FloatingPointModel"; const char _FloatingPointExceptions[] = "FloatingPointExceptions"; const char _ForceConformanceInForLoopScope[] = "ForceConformanceInForLoopScope"; -const char _ForceFileOutput[] = "ForceFileOutput"; const char _ForceSymbolReferences[] = "ForceSymbolReferences"; const char _ForcedIncludeFiles[] = "ForcedIncludeFiles"; const char _ForcedUsingFiles[] = "ForcedUsingFiles"; @@ -147,7 +144,6 @@ const char _IgnoreEmbeddedIDL[] = "IgnoreEmbeddedIDL"; const char _IgnoreImportLibrary[] = "IgnoreImportLibrary"; const char _IgnoreSpecificDefaultLibraries[] = "IgnoreSpecificDefaultLibraries"; const char _IgnoreStandardIncludePath[] = "IgnoreStandardIncludePath"; -const char _ImageHasSafeExceptionHandlers[] = "ImageHasSafeExceptionHandlers"; const char _ImportLibrary[] = "ImportLibrary"; const char _InlineFunctionExpansion[] = "InlineFunctionExpansion"; const char _IntrinsicFunctions[] = "IntrinsicFunctions"; @@ -172,7 +168,6 @@ const char _MidlCommandFile[] = "MidlCommandFile"; const char _MinimalRebuild[] = "MinimalRebuild"; const char _MkTypLibCompatible[] = "MkTypLibCompatible"; const char _ModuleDefinitionFile[] = "ModuleDefinitionFile"; -const char _MSDOSStubFileName[] = "MSDOSStubFileName"; const char _MultiProcessorCompilation[] = "MultiProcessorCompilation"; const char _Name[] = "Name"; const char _NoEntryPoint[] = "NoEntryPoint"; @@ -196,8 +191,6 @@ const char _PreprocessSuppressLineNumbers[] = "PreprocessSuppressLineNumbers const char _PreprocessToFile[] = "PreprocessToFile"; const char _PreventDllBinding[] = "PreventDllBinding"; const char _PrimaryOutput[] = "PrimaryOutput"; -const char _Profile[] = "Profile"; -const char _ProfileGuidedDatabase[] = "ProfileGuidedDatabase"; const char _ProcessorNumber[] = "ProcessorNumber"; const char _ProgramDatabase[] = "ProgramDatabase"; const char _ProgramDataBaseFileName[] = "ProgramDataBaseFileName"; @@ -216,7 +209,6 @@ const char _SetChecksum[] = "SetChecksum"; const char _ShowIncludes[] = "ShowIncludes"; const char _ShowProgress[] = "ShowProgress"; const char _SmallerTypeCheck[] = "SmallerTypeCheck"; -const char _SpecifySectionAttributes[] = "SpecifySectionAttributes"; const char _StackCommitSize[] = "StackCommitSize"; const char _StackReserveSize[] = "StackReserveSize"; const char _StringPooling[] = "StringPooling"; @@ -321,1838 +313,8 @@ inline XmlOutput::xml_output valueTagT( const triState v) return valueTag(v == _True ? "true" : "false"); } - -// VCXCLCompilerTool ------------------------------------------------- -VCXCLCompilerTool::VCXCLCompilerTool() - : BrowseInformation(_False), - BufferSecurityCheck(_False), - CreateHotpatchableImage(unset), - DisableLanguageExtensions(unset), - EnableFiberSafeOptimizations(unset), - EnablePREfast(unset), - ExpandAttributedSource(unset), - FloatingPointExceptions(unset), - ForceConformanceInForLoopScope(unset), - FunctionLevelLinking(unset), - GenerateXMLDocumentationFiles(unset), - IgnoreStandardIncludePath(unset), - IntrinsicFunctions(unset), - MinimalRebuild(unset), - MultiProcessorCompilation(unset), - OmitDefaultLibName(unset), - OmitFramePointers(unset), - Optimization("Disabled"), - OpenMPSupport(unset), - PreprocessKeepComments(unset), - PreprocessSuppressLineNumbers(unset), - RuntimeTypeInfo(unset), - ShowIncludes(unset), - SmallerTypeCheck(unset), - StringPooling(unset), - SuppressStartupBanner(unset), - TreatWarningAsError(unset), - TreatWChar_tAsBuiltInType(unset), - UndefineAllPreprocessorDefinitions(unset), - UseFullPaths(unset), - UseUnicodeForAssemblerListing(unset), - WholeProgramOptimization(unset) -{ -} - -bool VCXCLCompilerTool::parseOption(const char* option) -{ - // skip index 0 ('/' or '-') - char first = option[1]; - char second = option[2]; - char third = option[3]; - char fourth = option[4]; - bool found = true; - - switch (first) { - case '?': - qWarning("Generator: Option '/?' : MSVC.NET projects do not support outputting help info"); - found = false; - break; - case '@': - qWarning("Generator: Option '/@': MSVC.NET projects do not support the use of a response file"); - found = false; - break; - case 'l': - qWarning("Generator: Option '/link': qmake generator does not support passing link options through the compiler tool"); - found = false; - break; - case 'A': - if(second != 'I') { - found = false; - break; - } - AdditionalUsingDirectories += option+3; - break; - case 'C': - PreprocessKeepComments = _True; - break; - case 'D': - PreprocessorDefinitions += option+2; - break; - case 'E': - if(second == 'H') { - QString opt(option); - if (opt.endsWith("EHa")) - ExceptionHandling = "Async"; - else if (opt.endsWith("EHsc")) - ExceptionHandling = "Sync"; - else if (opt.endsWith("EHs")) - ExceptionHandling = "SyncCThrow"; - else { - ExceptionHandling = "false"; - } - break; - }else if(second == 'P') { - PreprocessSuppressLineNumbers = _True; - } - found = false; - break; - case 'F': - if(second <= '9' && second >= '0') { - AdditionalOptions += option; - break; - } else { - switch (second) { - case 'A': - if(third == 'c') { - AssemblerOutput = "AssemblyAndMachineCode"; - if(fourth == 's') - AssemblerOutput = "All"; - } else if(third == 's') { - AssemblerOutput = "AssemblyAndSourceCode"; - } else if(third == 'u') { - UseUnicodeForAssemblerListing = _True; - } else { - AssemblerOutput = "AssemblyCode"; - } - break; - case 'a': - AssemblerListingLocation = option+3; - break; - case 'C': - UseFullPaths = _True; - break; - case 'd': - ProgramDataBaseFileName += option+3; - case 'I': - ForcedIncludeFiles += option+3; - break; - case 'i': - PreprocessOutputPath += option+3; - break; - case 'm': - AdditionalOptions += option; - break; - case 'R': - BrowseInformation = _True; - BrowseInformationFile = option+3; - break; - case 'r': - BrowseInformation = _True; - BrowseInformationFile = option+3; - break; - case 'U': - ForcedUsingFiles += option+3; - break; - case 'o': - ObjectFileName = option+3; - break; - case 'p': - PrecompiledHeaderOutputFile = option+3; - break; - case 'x': - ExpandAttributedSource = _True; - break; - default: - found = false; - break; - } - } - break; - case 'G': - switch (second) { - case 'F': - StringPooling = _True; - break; - case 'L': - WholeProgramOptimization = _True; - if(third == '-') - WholeProgramOptimization = _False; - break; - case 'R': - RuntimeTypeInfo = _True; - if(third == '-') - RuntimeTypeInfo = _False; - break; - case 'S': - BufferSecurityCheck = _True; - if(third == '-') - BufferSecurityCheck = _False; - break; - case 'T': - EnableFiberSafeOptimizations = _True; - break; - case 'd': - CallingConvention = "Cdecl"; - break; - case 'm': - MinimalRebuild = _True; - if(third == '-') - MinimalRebuild = _False; - break; - case 'r': - CallingConvention = "FastCall"; - break; - case 'y': - FunctionLevelLinking = _True; - break; - case 'z': - CallingConvention = "StdCall"; - break; - default: - found = false; - break; - } - break; - case 'H': - AdditionalOptions += option; - break; - case 'I': - AdditionalIncludeDirectories += option+2; - break; - case 'L': - if(second == 'D') { - AdditionalOptions += option; - break; - } - found = false; - break; - case 'M': - if(second == 'D') { - RuntimeLibrary = "MultiThreadedDLL"; - if(third == 'd') - RuntimeLibrary = "MultiThreadedDebugDLL"; - break; - } else if(second == 'P') { - MultiProcessorCompilation = _True; - ProcessorNumber = option+3; - break; - } else if(second == 'T') { - RuntimeLibrary = "MultiThreaded"; - if(third == 'd') - RuntimeLibrary = "MultiThreadedDebug"; - break; - } - found = false; - break; - case 'O': - switch (second) { - case '1': - Optimization = "MinSpace"; - break; - case '2': - Optimization = "MaxSpeed"; - break; - case 'b': - if(third == '0') - InlineFunctionExpansion = "Disabled"; - else if(third == '1') - InlineFunctionExpansion = "OnlyExplicitInline"; - else if(third == '2') - InlineFunctionExpansion = "AnySuitable"; - else - found = false; - break; - case 'd': - Optimization = "Disabled"; - break; - case 'i': - IntrinsicFunctions = _True; - break; - case 'p': - if(third == 'e') - OpenMPSupport = _True; - else - found = false; - break; - case 's': - FavorSizeOrSpeed = "Size"; - break; - case 't': - FavorSizeOrSpeed = "Speed"; - break; - case 'x': - Optimization = "Full"; - break; - case 'y': - OmitFramePointers = _True; - if(third == '-') - OmitFramePointers = _False; - break; - default: - found = false; - break; - } - break; - case 'P': - PreprocessToFile = _True; - break; - case 'Q': - if(second == 'I') { - AdditionalOptions += option; - break; - } - found = false; - break; - case 'R': - if(second == 'T' && third == 'C') { - if(fourth == '1') - BasicRuntimeChecks = "EnableFastChecks"; - else if(fourth == 'c') - SmallerTypeCheck = _True; - else if(fourth == 's') - BasicRuntimeChecks = "StackFrameRuntimeCheck"; - else if(fourth == 'u') - BasicRuntimeChecks = "UninitializedLocalUsageCheck"; - else - found = false; break; - } - break; - case 'T': - if(second == 'C') { - CompileAs = "CompileAsC"; - } else if(second == 'P') { - CompileAs = "CompileAsCpp"; - } else { - qWarning("Generator: Options '/Tp<filename>' and '/Tc<filename>' are not supported by qmake"); - found = false; break; - } - break; - case 'U': - UndefinePreprocessorDefinitions += option+2; - break; - case 'V': - AdditionalOptions += option; - break; - case 'W': - switch (second) { - case 'a': - WarningLevel = "EnableAllWarnings"; - break; - case '4': - WarningLevel = "Level4"; - break; - case '3': - WarningLevel = "Level3"; - break; - case '2': - WarningLevel = "Level2"; - break; - case '1': - WarningLevel = "Level1"; - break; - case '0': - WarningLevel = "TurnOffAllWarnings"; - break; - case 'L': - AdditionalOptions += option; - break; - case 'X': - TreatWarningAsError = _True; - break; - case 'p': - if(third == '6' && fourth == '4') { - // Deprecated for VS2010 but can be used under Additional Options. - AdditionalOptions += option; - break; - } - // Fallthrough - default: - found = false; break; - } - break; - case 'X': - IgnoreStandardIncludePath = _True; - break; - case 'Y': - switch (second) { - case '\0': - case '-': - AdditionalOptions += option; - break; - case 'c': - PrecompiledHeader = "Create"; - PrecompiledHeaderFile = option+3; - break; - case 'd': - case 'l': - AdditionalOptions += option; - break; - case 'u': - PrecompiledHeader = "Use"; - PrecompiledHeaderFile = option+3; - break; - default: - found = false; break; - } - break; - case 'Z': - switch (second) { - case '7': - DebugInformationFormat = "OldStyle"; - break; - case 'I': - DebugInformationFormat = "EditAndContinue"; - break; - case 'i': - DebugInformationFormat = "ProgramDatabase"; - break; - case 'l': - OmitDefaultLibName = _True; - break; - case 'a': - DisableLanguageExtensions = _True; - break; - case 'e': - DisableLanguageExtensions = _False; - break; - case 'c': - if(third == ':') { - const char *c = option + 4; - // Go to the end of the option - while ( *c != '\0' && *c != ' ' && *c != '-') - ++c; - if(fourth == 'f') - ForceConformanceInForLoopScope = ((*c) == '-' ? _False : _True); - else if(fourth == 'w') - TreatWChar_tAsBuiltInType = ((*c) == '-' ? _False : _True); - else - found = false; - } else { - found = false; break; - } - break; - case 'g': - case 'm': - case 's': - AdditionalOptions += option; - break; - case 'p': - switch (third) - { - case '\0': - case '1': - StructMemberAlignment = "1Byte"; - if(fourth == '6') - StructMemberAlignment = "16Bytes"; - break; - case '2': - StructMemberAlignment = "2Bytes"; - break; - case '4': - StructMemberAlignment = "4Bytes"; - break; - case '8': - StructMemberAlignment = "8Bytes"; - break; - default: - found = false; break; - } - break; - default: - found = false; break; - } - break; - case 'a': - if (second == 'r' && third == 'c' && fourth == 'h') { - if (option[5] == ':') { - const char *o = option; - if (o[6] == 'S' && o[7] == 'S' && o[8] == 'E') { - EnableEnhancedInstructionSet = o[9] == '2' ? "StreamingSIMDExtensions2" : "StreamingSIMDExtensions"; - break; - } - } - } else if (second == 'n' && third == 'a' && fourth == 'l') { - EnablePREfast = _True; - break; - } - found = false; - break; - case 'b': // see http://msdn.microsoft.com/en-us/library/fwkeyyhe%28VS.100%29.aspx - if (second == 'i' && third == 'g' && fourth == 'o') { - const char *o = option; - if (o[5] == 'b' && o[6] == 'j') { - AdditionalOptions += option; - break; - } - } - found = false; - break; - case 'c': - if(second == 'l') { - if(*(option+5) == 'p') { - CompileAsManaged = "Pure"; - } else if(*(option+5) == 's') { - CompileAsManaged = "Safe"; - } else if(*(option+5) == 'o') { - CompileAsManaged = "OldSyntax"; - } else { - CompileAsManaged = "true"; - } - } else { - found = false; - break; - } - break; - case 'd': - if(second != 'o' && third == 'c') { - GenerateXMLDocumentationFiles = _True; - XMLDocumentationFileName += option+4; - break; - } - found = false; - break; - case 'e': - if (second == 'r' && third == 'r' && fourth == 'o') { - if (option[12] == ':') { - if ( option[13] == 'n') { - ErrorReporting = "None"; - } else if (option[13] == 'p') { - ErrorReporting = "Prompt"; - } else if (option[13] == 'q') { - ErrorReporting = "Queue"; - } else if (option[13] == 's') { - ErrorReporting = "Send"; - } else { - found = false; - } - break; - } - } - found = false; - break; - case 'f': - if(second == 'p' && third == ':') { - // Go to the end of the option - const char *c = option + 4; - while (*c != '\0' && *c != ' ' && *c != '-') - ++c; - switch (fourth) { - case 'e': - FloatingPointExceptions = ((*c) == '-' ? _False : _True); - break; - case 'f': - FloatingPointModel = "Fast"; - break; - case 'p': - FloatingPointModel = "Precise"; - break; - case 's': - FloatingPointModel = "Strict"; - break; - default: - found = false; - break; - } - } - break; - case 'h': - if(second == 'o' && third == 't' && fourth == 'p') { - CreateHotpatchableImage = _True; - break; - } - qWarning("Generator: Option '/help': MSVC.NET projects do not support outputting help info"); - found = false; - break; - case 'n': - if(second == 'o' && third == 'l' && fourth == 'o') { - SuppressStartupBanner = _True; - break; - } - found = false; - break; - case 'o': - if (second == 'p' && third == 'e' && fourth == 'n') { - OpenMPSupport = _True; - break; - } - found = false; - break; - case 's': - if(second == 'h' && third == 'o' && fourth == 'w') { - ShowIncludes = _True; - break; - } - found = false; - break; - case 'u': - UndefineAllPreprocessorDefinitions = _True; - break; - case 'v': - if(second == 'd' || second == 'm') { - AdditionalOptions += option; - break; - } - found = false; - break; - case 'w': - switch (second) { - case 'd': - DisableSpecificWarnings += option+3; - break; - case 'e': - TreatSpecificWarningsAsErrors = option+3; - break; - default: - AdditionalOptions += option; - } - break; - default: - AdditionalOptions += option; - break; - } - if(!found) { - warn_msg(WarnLogic, "Could not parse Compiler option: %s, added as AdditionalOption", option); - AdditionalOptions += option; - } - return true; -} - -// VCLinkerTool ----------------------------------------------------- -VCXLinkerTool::VCXLinkerTool() - : AllowIsolation(unset), - AssemblyDebug(unset), - DataExecutionPrevention(unset), - DelaySign(unset), - EnableCOMDATFolding(unset), - EnableUAC(unset), - FixedBaseAddress(unset), - GenerateDebugInformation(unset), - GenerateManifest(unset), - GenerateMapFile(unset), - HeapCommitSize(-1), - HeapReserveSize(-1), - IgnoreAllDefaultLibraries(unset), - IgnoreEmbeddedIDL(unset), - IgnoreImportLibrary(_True), - ImageHasSafeExceptionHandlers(unset), - LargeAddressAware(unset), - LinkDLL(unset), - LinkIncremental(unset), - LinkStatus(unset), - MapExports(unset), - NoEntryPoint(unset), - OptimizeReferences(unset), - PreventDllBinding(unset), - RandomizedBaseAddress(unset), - RegisterOutput(unset), - SectionAlignment(-1), - SetChecksum(unset), - //StackCommitSize(-1), - //StackReserveSize(-1), - SupportNobindOfDelayLoadedDLL(unset), - SupportUnloadOfDelayLoadedDLL(unset), - SuppressStartupBanner(unset), - SwapRunFromCD(unset), - SwapRunFromNet(unset), - TerminalServerAware(unset), - TreatLinkerWarningAsErrors(unset), - TurnOffAssemblyGeneration(unset), - TypeLibraryResourceID(0), - UACUIAccess(unset) -{ -} - -// Hashing routine to do fast option lookups ---- -// Slightly rewritten to stop on ':' ',' and '\0' -// Original routine in qtranslator.cpp ---------- -static uint elfHash(const char* name) -{ - const uchar *k; - uint h = 0; - uint g; - - if(name) { - k = (const uchar *) name; - while((*k) && - (*k)!= ':' && - (*k)!=',' && - (*k)!=' ') { - h = (h << 4) + *k++; - if((g = (h & 0xf0000000)) != 0) - h ^= g >> 24; - h &= ~g; - } - } - if(!h) - h = 1; - return h; -} - -//#define USE_DISPLAY_HASH -#ifdef USE_DISPLAY_HASH -static void displayHash(const char* str) -{ - printf("case 0x%07x: // %s\n break;\n", elfHash(str), str); -} -#endif - -bool VCXLinkerTool::parseOption(const char* option) -{ -#ifdef USE_DISPLAY_HASH - // Main options - displayHash("/ALIGN"); displayHash("/ALLOWBIND"); displayHash("/ASSEMBLYMODULE"); - displayHash("/ASSEMBLYRESOURCE"); displayHash("/BASE"); displayHash("/DEBUG"); - displayHash("/DEF"); displayHash("/DEFAULTLIB"); displayHash("/DELAY"); - displayHash("/DELAYLOAD"); displayHash("/DLL"); displayHash("/DRIVER"); - displayHash("/ENTRY"); displayHash("/EXETYPE"); displayHash("/EXPORT"); - displayHash("/FIXED"); displayHash("/FORCE"); displayHash("/HEAP"); - displayHash("/IDLOUT"); displayHash("/IGNORE"); displayHash("/IGNOREIDL"); displayHash("/IMPLIB"); - displayHash("/INCLUDE"); displayHash("/INCREMENTAL"); displayHash("/LARGEADDRESSAWARE"); - displayHash("/LIBPATH"); displayHash("/LTCG"); displayHash("/MACHINE"); - displayHash("/MAP"); displayHash("/MAPINFO"); displayHash("/MERGE"); - displayHash("/MIDL"); displayHash("/NOASSEMBLY"); displayHash("/NODEFAULTLIB"); - displayHash("/NOENTRY"); displayHash("/NOLOGO"); displayHash("/OPT"); - displayHash("/ORDER"); displayHash("/OUT"); displayHash("/PDB"); - displayHash("/PDBSTRIPPED"); displayHash("/RELEASE"); displayHash("/SECTION"); - displayHash("/STACK"); displayHash("/STUB"); displayHash("/SUBSYSTEM"); - displayHash("/SWAPRUN"); displayHash("/TLBID"); displayHash("/TLBOUT"); - displayHash("/TSAWARE"); displayHash("/VERBOSE"); displayHash("/VERSION"); - displayHash("/VXD"); displayHash("/WS "); displayHash("/libpath"); - -#endif -#ifdef USE_DISPLAY_HASH - // Sub options - displayHash("UNLOAD"); displayHash("NOBIND"); displayHash("no"); displayHash("NOSTATUS"); displayHash("STATUS"); - displayHash("AM33"); displayHash("ARM"); displayHash("CEE"); displayHash("EBC"); displayHash("IA64"); displayHash("X86"); displayHash("X64"); displayHash("M32R"); - displayHash("MIPS"); displayHash("MIPS16"); displayHash("MIPSFPU"); displayHash("MIPSFPU16"); displayHash("MIPSR41XX"); displayHash("PPC"); - displayHash("SH3"); displayHash("SH3DSP"); displayHash("SH4"); displayHash("SH5"); displayHash("THUMB"); displayHash("TRICORE"); displayHash("EXPORTS"); - displayHash("LINES"); displayHash("REF"); displayHash("NOREF"); displayHash("ICF"); displayHash("WIN98"); displayHash("NOWIN98"); - displayHash("CONSOLE"); displayHash("EFI_APPLICATION"); displayHash("EFI_BOOT_SERVICE_DRIVER"); displayHash("EFI_ROM"); displayHash("EFI_RUNTIME_DRIVER"); displayHash("NATIVE"); - displayHash("POSIX"); displayHash("WINDOWS"); displayHash("WINDOWSCE"); displayHash("NET"); displayHash("CD"); displayHash("NO"); -#endif - bool found = true; - switch (elfHash(option)) { - case 0x6b21972: // /DEFAULTLIB:library - case 0xaca9d75: // /EXETYPE[:DYNAMIC | :DEV386] - case 0x3ad5444: // /EXPORT:entryname[,@ordinal[,NONAME]][,DATA] - case 0x3dc3455: // /IGNORE:number,number,number,number ### NOTE: This one is undocumented, but it is even used by Microsoft. - // In recent versions of the Microsoft linker they have disabled this undocumented feature. - case 0x0034bc4: // /VXD - AdditionalOptions += option; - break; - case 0x3360dbe: // /ALIGN[:number] - SectionAlignment = QString(option+7).toLongLong(); - break; - case 0x1485c34: // /ALLOWBIND[:NO] - if(*(option+10) == ':' && (*(option+11) == 'n' || *(option+11) == 'N')) - PreventDllBinding = _False; - else - PreventDllBinding = _True; - break; - case 0x312011e: // /ALLOWISOLATION[:NO] - if(*(option+15) == ':' && (*(option+16) == 'n' || *(option+16) == 'N')) - AllowIsolation = _False; - else - AllowIsolation = _True; - break; - case 0x679c075: // /ASSEMBLYMODULE:filename - AddModuleNamesToAssembly += option+15; - break; - case 0x75f35f7: // /ASSEMBLYDEBUG[:DISABLE] - if(*(option+14) == ':' && (*(option+15) == 'D')) - AssemblyDebug = _False; - else - AssemblyDebug = _True; - break; - case 0x43294a5: // /ASSEMBLYLINKRESOURCE:filename - AssemblyLinkResource += option+22; - break; - case 0x062d065: // /ASSEMBLYRESOURCE:filename - EmbedManagedResourceFile += option+18; - break; - case 0x0336675: // /BASE:{address | @filename,key} - // Do we need to do a manual lookup when '@filename,key'? - // Seems BaseAddress only can contain the location... - // We don't use it in Qt, so keep it simple for now - BaseAddress = option+6; - break; - case 0x63bf065: // /CLRIMAGETYPE:{IJW|PURE|SAFE} - if(*(option+14) == 'I') - CLRImageType = "ForceIJWImage"; - else if(*(option+14) == 'P') - CLRImageType = "ForcePureILImage"; - else if(*(option+14) == 'S') - CLRImageType = "ForceSafeILImage"; - break; - case 0x5f2a6a2: // /CLRSUPPORTLASTERROR{:NO | SYSTEMDLL} - if(*(option+20) == ':') { - if(*(option+21) == 'N') { - CLRSupportLastError = "Disabled"; - } else if(*(option+21) == 'S') { - CLRSupportLastError = "SystemDlls"; - } - } else { - CLRSupportLastError = "Enabled"; - } - break; - case 0xc7984f5: // /CLRTHREADATTRIBUTE:{STA|MTA|NONE} - if(*(option+20) == 'N') - CLRThreadAttribute = "DefaultThreadingAttribute"; - else if(*(option+20) == 'M') - CLRThreadAttribute = "MTAThreadingAttribute"; - else if(*(option+20) == 'S') - CLRThreadAttribute = "STAThreadingAttribute"; - break; - case 0xa8c637b: // /CLRUNMANAGEDCODECHECK[:NO] - if(*(option+23) == 'N') - CLRUnmanagedCodeCheck = _False; - else - CLRUnmanagedCodeCheck = _True; - break; - case 0x3389797: // /DEBUG - GenerateDebugInformation = _True; - break; - case 0x0033896: // /DEF:filename - ModuleDefinitionFile = option+5; - break; - case 0x338a069: // /DELAY:{UNLOAD | NOBIND} - if(*(option+7) == 'U') - SupportNobindOfDelayLoadedDLL = _True; - else if(*(option+7) == 'N') - SupportUnloadOfDelayLoadedDLL = _True; - break; - case 0x06f4bf4: // /DELAYLOAD:dllname - DelayLoadDLLs += option+11; - break; - case 0x06d451e: // /DELAYSIGN[:NO] - if(*(option+10) == ':' && (*(option+11) == 'n' || *(option+11) == 'N')) - DelaySign = _False; - else - DelaySign = _True; - break; - case 0x003390c: // /DLL - LinkDLL = _True; - break; - case 0x396ea92: // /DRIVER[:UPONLY | :WDM] - if((*(option+7) == ':') && (*(option+8) == 'U')) - Driver = "UpOnly"; - else if((*(option+7) == ':') && (*(option+8) == 'W')) - Driver = "WDM"; - else - Driver = "Driver"; - break; - case 0x2ee8415: // /DYNAMICBASE[:NO] - if(*(option+12) == ':' && (*(option+13) == 'n' || *(option+13) == 'N')) - RandomizedBaseAddress = _False; - else - RandomizedBaseAddress = _True; - break; - case 0x33a3979: // /ENTRY:function - EntryPointSymbol = option+7; - break; - case 0x4504334: // /ERRORREPORT:[ NONE | PROMPT | QUEUE | SEND ] - if(*(option+12) == ':' ) { - if(*(option+13) == 'N') - LinkErrorReporting = "NoErrorReport"; - else if(*(option+13) == 'P') - LinkErrorReporting = "PromptImmediately"; - else if(*(option+13) == 'Q') - LinkErrorReporting = "QueueForNextLogin"; - else if(*(option+13) == 'S') - LinkErrorReporting = "SendErrorReport"; - } - break; - case 0x33aec94: // /FIXED[:NO] - if(*(option+6) == ':' && (*(option+7) == 'n' || *(option+7) == 'N')) - FixedBaseAddress = _False; - else - FixedBaseAddress = _True; - break; - case 0x33b4675: // /FORCE:[MULTIPLE|UNRESOLVED] - if(*(option+6) == ':' && *(option+7) == 'M' ) - ForceFileOutput = "MultiplyDefinedSymbolOnly"; - else if(*(option+6) == ':' && *(option+7) == 'U' ) - ForceFileOutput = "UndefinedSymbolOnly"; - else - ForceFileOutput = "Enabled"; - break; - case 0x96d4e4e: // /FUNCTIONPADMIN[:space] - if(*(option+15) == ':') { - if(*(option+16) == '5') - CreateHotPatchableImage = "X86Image"; - else if(*(option+16) == '6') - CreateHotPatchableImage = "X64Image"; - else if((*(option+16) == '1') && (*(option+17) == '6')) - CreateHotPatchableImage = "ItaniumImage"; - } else { - CreateHotPatchableImage = "Enabled"; - } - break; - case 0x033c960: // /HEAP:reserve[,commit] - { - QStringList both = QString(option+6).split(","); - HeapReserveSize = both[0].toLongLong(); - if(both.count() == 2) - HeapCommitSize = both[1].toLongLong(); - } - break; - case 0x3d91494: // /IDLOUT:[path\]filename - MergedIDLBaseFileName = option+8; - break; - case 0x345a04c: // /IGNOREIDL - IgnoreEmbeddedIDL = _True; - break; - case 0x3e250e2: // /IMPLIB:filename - ImportLibrary = option+8; - break; - case 0xe281ab5: // /INCLUDE:symbol - ForceSymbolReferences += option+9; - break; - case 0xb28103c: // /INCREMENTAL[:no] - if(*(option+12) == ':' && - (*(option+13) == 'n' || *(option+13) == 'N')) - LinkIncremental = _False; - else - LinkIncremental = _True; - break; - case 0x07f1ab2: // /KEYCONTAINER:name - KeyContainer = option+14; - break; - case 0xfadaf35: // /KEYFILE:filename - KeyFile = option+9; - break; - case 0x26e4675: // /LARGEADDRESSAWARE[:no] - if(*(option+18) == ':' && - *(option+19) == 'n') - LargeAddressAware = _False; - else - LargeAddressAware = _True; - break; - case 0x2f96bc8: // /libpath:dir - case 0x0d745c8: // /LIBPATH:dir - AdditionalLibraryDirectories += option+9; - break; - case 0x0341877: // /LTCG[:NOSTATUS|:STATUS] - config->WholeProgramOptimization = _True; - LinkTimeCodeGeneration = "UseLinkTimeCodeGeneration"; - if(*(option+5) == ':') { - const char* str = option+6; - if (*str == 'S') - LinkStatus = _True; - else if (*str == 'N') - LinkStatus = _False; -#ifndef Q_OS_WIN - else if (strncasecmp(str, "pginstrument", 12)) - LinkTimeCodeGeneration = "PGInstrument"; - else if (strncasecmp(str, "pgoptimize", 10)) - LinkTimeCodeGeneration = "PGOptimization"; - else if (strncasecmp(str, "pgupdate", 8 )) - LinkTimeCodeGeneration = "PGUpdate"; -#else - - else if (_stricmp(str, "pginstrument")) - LinkTimeCodeGeneration = "PGInstrument"; - else if (_stricmp(str, "pgoptimize")) - LinkTimeCodeGeneration = "PGOptimization"; - else if (_stricmp(str, "pgupdate")) - LinkTimeCodeGeneration = "PGUpdate"; -#endif - } - break; - case 0x379ED25: - case 0x157cf65: // /MACHINE:{AM33|ARM|CEE|IA64|X86|M32R|MIPS|MIPS16|MIPSFPU|MIPSFPU16|MIPSR41XX|PPC|SH3|SH4|SH5|THUMB|TRICORE} - switch (elfHash(option+9)) { - case 0x0005bb6: // X86 - TargetMachine = "MachineX86"; - break; - case 0x0005b94: // X64 - TargetMachine = "MachineX64"; - break; - case 0x000466d: // ARM - TargetMachine = "MachineARM"; - break; - case 0x0004963: // EBC - TargetMachine = "MachineEBC"; - break; - case 0x004d494: // IA64 - TargetMachine = "MachineIA64"; - break; - case 0x0051e53: // MIPS - TargetMachine = "MachineMIPS"; - break; - case 0x51e5646: // MIPS16 - TargetMachine = "MachineMIPS16"; - break; - case 0x1e57b05: // MIPSFPU - TargetMachine = "MachineMIPSFPU"; - break; - case 0x57b09a6: // MIPSFPU16 - TargetMachine = "MachineMIPSFPU16"; - break; - case 0x00057b4: // SH4 - TargetMachine = "MachineSH4"; - break; - case 0x058da12: // THUMB - TargetMachine = "MachineTHUMB"; - break; - // put the others in AdditionalOptions... - case 0x0046063: // AM33 - case 0x0004795: // CEE - case 0x0050672: // M32R - case 0x5852738: // MIPSR41XX - case 0x0005543: // PPC - case 0x00057b3: // SH3 - case 0x57b7980: // SH3DSP - case 0x00057b5: // SH5 - case 0x96d8435: // TRICORE - default: - AdditionalOptions += option; - break; - } - break; - case 0x62d9e94: // /MANIFEST[:NO] - if ((*(option+9) == ':' && (*(option+10) == 'N' || *(option+10) == 'n'))) - GenerateManifest = _False; - else - GenerateManifest = _True; - break; - case 0x8b64559: // /MANIFESTDEPENDENCY:manifest_dependency - AdditionalManifestDependencies += option+20; - break; - case 0xe9e8195: // /MANIFESTFILE:filename - ManifestFile = option+14; - break; - case 0x9e9fb83: // /MANIFESTUAC http://msdn.microsoft.com/en-us/library/bb384691%28VS.100%29.aspx - if ((*(option+12) == ':' && (*(option+13) == 'N' || *(option+13) == 'n'))) - EnableUAC = _False; - else if((*(option+12) == ':' && (*(option+13) == 'l' || *(option+14) == 'e'))) { // level - if(*(option+20) == 'a') - UACExecutionLevel = "AsInvoker"; - else if(*(option+20) == 'h') - UACExecutionLevel = "HighestAvailable"; - else if(*(option+20) == 'r') - UACExecutionLevel = "RequireAdministrator"; - } else if((*(option+12) == ':' && (*(option+13) == 'u' || *(option+14) == 'i'))) { // uiAccess - if(*(option+22) == 't') - UACUIAccess = _True; - else - UACUIAccess = _False; - } else if((*(option+12) == ':' && (*(option+13) == 'f' || *(option+14) == 'r'))) { // fragment - AdditionalOptions += option; - }else - EnableUAC = _True; - break; - case 0x0034160: // /MAP[:filename] - GenerateMapFile = _True; - MapFileName = option+5; - break; - case 0x164e1ef: // /MAPINFO:{EXPORTS} - if(*(option+9) == 'E') - MapExports = _True; - break; - case 0x341a6b5: // /MERGE:from=to - MergeSections = option+7; - break; - case 0x0341d8c: // /MIDL:@file - MidlCommandFile = option+7; - break; - case 0x84e2679: // /NOASSEMBLY - TurnOffAssemblyGeneration = _True; - break; - case 0x2b21942: // /NODEFAULTLIB[:library] - if(*(option+13) == '\0') - IgnoreAllDefaultLibraries = _True; - else - IgnoreSpecificDefaultLibraries += option+14; - break; - case 0x33a3a39: // /NOENTRY - NoEntryPoint = _True; - break; - case 0x434138f: // /NOLOGO - SuppressStartupBanner = _True; - break; - case 0xc841054: // /NXCOMPAT[:NO] - if ((*(option+9) == ':' && (*(option+10) == 'N' || *(option+10) == 'n'))) - DataExecutionPrevention = _False; - else - DataExecutionPrevention = _True; - break; - case 0x0034454: // /OPT:{REF | NOREF | ICF[=iterations] | NOICF | WIN98 | NOWIN98} - { - char third = *(option+7); - switch (third) { - case 'F': // REF - if(*(option+5) == 'R') { - OptimizeReferences = _True; - } else { // ICF[=iterations] - EnableCOMDATFolding = _True; - // [=iterations] case is not documented - } - break; - case 'R': // NOREF - OptimizeReferences = _False; - break; - case 'I': // NOICF - EnableCOMDATFolding = _False; - break; - default: - found = false; - } - } - break; - case 0x34468a2: // /ORDER:@filename - FunctionOrder = option+8; - break; - case 0x00344a4: // /OUT:filename - OutputFile = option+5; - break; - case 0x0034482: // /PDB:filename - ProgramDatabaseFile = option+5; - break; - case 0xa2ad314: // /PDBSTRIPPED:pdb_file_name - StripPrivateSymbols = option+13; - break; - case 0x00344b4: // /PGD:filename - ProfileGuidedDatabase = option+5; - break; - case 0x573af45: // /PROFILE - Profile = _True; - break; - case 0x6a09535: // /RELEASE - SetChecksum = _True; - break; - case 0x75AA4D8: // /SAFESEH:{NO} - { - if(*(option+8) == ':' && *(option+9) == 'N') - ImageHasSafeExceptionHandlers = _False; - else - ImageHasSafeExceptionHandlers = _True; - } - break; - case 0x7988f7e: // /SECTION:name,[E][R][W][S][D][K][L][P][X][,ALIGN=#] - SpecifySectionAttributes = option+9; - break; - case 0x348857b: // /STACK:reserve[,commit] - { - QStringList both = QString(option+7).split(","); - StackReserveSize = both[0].toLongLong(); - if(both.count() == 2) - StackCommitSize = both[1].toLongLong(); - } - break; - case 0x0348992: // /STUB:filename - MSDOSStubFileName = option+6; - break; - case 0x9B3C00D: - case 0x78dc00d: // /SUBSYSTEM:{CONSOLE|EFI_APPLICATION|EFI_BOOT_SERVICE_DRIVER|EFI_ROM|EFI_RUNTIME_DRIVER|NATIVE|POSIX|WINDOWS|WINDOWSCE}[,major[.minor]] - { - // Split up in subsystem, and version number - QStringList both = QString(option+11).split(","); - switch (elfHash(both[0].toLatin1())) { - case 0x8438445: // CONSOLE - SubSystem = "Console"; - break; - case 0xbe29493: // WINDOWS - SubSystem = "Windows"; - break; - case 0x5268ea5: // NATIVE - SubSystem = "Native"; - break; - case 0x240949e: // EFI_APPLICATION - SubSystem = "EFI Application"; - break; - case 0xe617652: // EFI_BOOT_SERVICE_DRIVER - SubSystem = "EFI Boot Service Driver"; - break; - case 0x9af477d: // EFI_ROM - SubSystem = "EFI ROM"; - break; - case 0xd34df42: // EFI_RUNTIME_DRIVER - SubSystem = "EFI Runtime"; - break; - case 0x2949c95: // WINDOWSCE - SubSystem = "WindowsCE"; - break; - case 0x05547e8: // POSIX - SubSystem = "POSIX"; - break; - // The following are undocumented, so add them to AdditionalOptions - case 0x4B69795: // windowsce - AdditionalOptions += option; - break; - default: - found = false; - } - } - break; - case 0x8b654de: // /SWAPRUN:{NET | CD} - if(*(option+9) == 'N') - SwapRunFromNet = _True; - else if(*(option+9) == 'C') - SwapRunFromCD = _True; - else - found = false; - break; - case 0x34906d4: // /TLBID:id - TypeLibraryResourceID = QString(option+7).toLongLong(); - break; - case 0x4907494: // /TLBOUT:[path\]filename - TypeLibraryFile = option+8; - break; - case 0x976b525: // /TSAWARE[:NO] - if(*(option+8) == ':') - TerminalServerAware = _False; - else - TerminalServerAware = _True; - break; - case 0xaa67735: // /VERBOSE[:ICF |:LIB |:REF |:SAFESEH] - if(*(option+9) == ':') { - if (*(option+10) == 'I') { - ShowProgress = "LinkVerboseICF"; - } else if ( *(option+10) == 'L') { - ShowProgress = "LinkVerboseLib"; - } else if ( *(option+10) == 'R') { - ShowProgress = "LinkVerboseREF"; - } else if ( *(option+10) == 'S') { - ShowProgress = "LinkVerboseSAFESEH"; - } else if ( *(option+10) == 'C') { - ShowProgress = "LinkVerboseCLR"; - } - } else { - ShowProgress = "LinkVerbose"; - } - break; - case 0xaa77f7e: // /VERSION:major[.minor] - Version = option+9; - break; - case 0x0034c50: // /WS[:NO] - if(*(option+3) == ':') - TreatLinkerWarningAsErrors = _False; - else - TreatLinkerWarningAsErrors = _True; - break; - default: - AdditionalOptions += option; - break; - } - if(!found) { - warn_msg(WarnLogic, "Could not parse Linker options: %s, added as AdditionalOption", option); - AdditionalOptions += option; - } - return found; -} - -// VCMIDLTool ------------------------------------------------------- -VCXMIDLTool::VCXMIDLTool() - : ApplicationConfigurationMode(unset), - ErrorCheckAllocations(unset), - ErrorCheckBounds(unset), - ErrorCheckEnumRange(unset), - ErrorCheckRefPointers(unset), - ErrorCheckStubData(unset), - GenerateStublessProxies(unset), - GenerateTypeLibrary(unset), - IgnoreStandardIncludePath(unset), - LocaleID(-1), - MkTypLibCompatible(unset), - SuppressCompilerWarnings(unset), - SuppressStartupBanner(unset), - ValidateAllParameters(unset), - WarnAsError(unset) -{ -} - -bool VCXMIDLTool::parseOption(const char* option) -{ -#ifdef USE_DISPLAY_HASH - displayHash("/D name[=def]"); displayHash("/I directory-list"); displayHash("/Oi"); - displayHash("/Oic"); displayHash("/Oicf"); displayHash("/Oif"); displayHash("/Os"); - displayHash("/U name"); displayHash("/WX"); displayHash("/W{0|1|2|3|4}"); - displayHash("/Zp {N}"); displayHash("/Zs"); displayHash("/acf filename"); - displayHash("/align {N}"); displayHash("/app_config"); displayHash("/c_ext"); - displayHash("/char ascii7"); displayHash("/char signed"); displayHash("/char unsigned"); - displayHash("/client none"); displayHash("/client stub"); displayHash("/confirm"); - displayHash("/cpp_cmd cmd_line"); displayHash("/cpp_opt options"); - displayHash("/cstub filename"); displayHash("/dlldata filename"); displayHash("/env win32"); - displayHash("/env win64"); displayHash("/error all"); displayHash("/error allocation"); - displayHash("/error bounds_check"); displayHash("/error enum"); displayHash("/error none"); - displayHash("/error ref"); displayHash("/error stub_data"); displayHash("/h filename"); - displayHash("/header filename"); displayHash("/iid filename"); displayHash("/lcid"); - displayHash("/mktyplib203"); displayHash("/ms_ext"); displayHash("/ms_union"); - displayHash("/msc_ver <nnnn>"); displayHash("/newtlb"); displayHash("/no_cpp"); - displayHash("/no_def_idir"); displayHash("/no_default_epv"); displayHash("/no_format_opt"); - displayHash("/no_warn"); displayHash("/nocpp"); displayHash("/nologo"); displayHash("/notlb"); - displayHash("/o filename"); displayHash("/oldnames"); displayHash("/oldtlb"); - displayHash("/osf"); displayHash("/out directory"); displayHash("/pack {N}"); - displayHash("/prefix all"); displayHash("/prefix client"); displayHash("/prefix server"); - displayHash("/prefix switch"); displayHash("/protocol all"); displayHash("/protocol dce"); - displayHash("/protocol ndr64"); displayHash("/proxy filename"); displayHash("/robust"); - displayHash("/rpcss"); displayHash("/savePP"); displayHash("/server none"); - displayHash("/server stub"); displayHash("/sstub filename"); displayHash("/syntax_check"); - displayHash("/target {system}"); displayHash("/tlb filename"); displayHash("/use_epv"); - displayHash("/win32"); displayHash("/win64"); -#endif - bool found = true; - int offset = 0; - switch(elfHash(option)) { - case 0x0000334: // /D name[=def] - PreprocessorDefinitions += option+3; - break; - case 0x0000339: // /I directory-list - AdditionalIncludeDirectories += option+3; - break; - case 0x0345f96: // /Oicf - case 0x00345f6: // /Oif - GenerateStublessProxies = _True; - break; - case 0x0000345: // /U name - UndefinePreprocessorDefinitions += option+3; - break; - case 0x00034c8: // /WX - WarnAsError = _True; - break; - case 0x3582fde: // /align {N} - offset = 3; // Fallthrough - case 0x0003510: // /Zp {N} - switch (*(option+offset+4)) { - case '1': - StructMemberAlignment = (*(option+offset+5) == '\0') ? "1" : "16"; - break; - case '2': - StructMemberAlignment = "2"; - break; - case '4': - StructMemberAlignment = "4"; - break; - case '8': - StructMemberAlignment = "8"; - break; - default: - found = false; - } - break; - case 0x5b1cb97: // /app_config - ApplicationConfigurationMode = _True; - break; - case 0x0359e82: // /char {ascii7|signed|unsigned} - switch(*(option+6)) { - case 'a': - DefaultCharType = "Ascii"; - break; - case 's': - DefaultCharType = "Signed"; - break; - case 'u': - DefaultCharType = "Unsigned"; - break; - default: - found = false; - } - break; - case 0x5a2fc64: // /client {none|stub} - if(*(option+8) == 's') - GenerateClientFiles = "Stub"; - else - GenerateClientFiles = "None"; - break; - case 0xa766524: // /cpp_opt options - CPreprocessOptions += option+9; - break; - case 0x35aabb2: // /cstub filename - ClientStubFile = option+7; - break; - case 0xb32abf1: // /dlldata filename - DLLDataFileName = option + 9; - break; - case 0x0035c56: // /env {win32|ia64|x64} - if(*(option+7) == 'w' && *(option+10) == '3') - TargetEnvironment = "Win32"; - else if(*(option+7) == 'i') - TargetEnvironment = "Itanium"; - else if(*(option+7) == 'x') - TargetEnvironment = "X64"; - else - AdditionalOptions += option; - break; - case 0x35c9962: // /error {all|allocation|bounds_check|enum|none|ref|stub_data} - EnableErrorChecks = midlEnableCustom; - switch (*(option+7)) { - case '\0': - EnableErrorChecks = "EnableCustom"; - break; - case 'a': - if(*(option+10) == '\0') - EnableErrorChecks = "All"; - else - ErrorCheckAllocations = _True; - break; - case 'b': - ErrorCheckBounds = _True; - break; - case 'e': - ErrorCheckEnumRange = _True; - break; - case 'n': - EnableErrorChecks = "None"; - break; - case 'r': - ErrorCheckRefPointers = _True; - break; - case 's': - ErrorCheckStubData = _True; - break; - default: - found = false; - } - break; - case 0x5eb7af2: // /header filename - offset = 5; - case 0x0000358: // /h filename - HeaderFileName = option + offset + 3; - break; - case 0x0035ff4: // /iid filename - InterfaceIdentifierFileName = option+5; - break; - case 0x64b7933: // /mktyplib203 - MkTypLibCompatible = _True; - break; - case 0x64ceb12: // /newtlb - TypeLibFormat = "NewFormat"; - break; - case 0x8e0b0a2: // /no_def_idir - IgnoreStandardIncludePath = _True; - break; - case 0x65635ef: // /nologo - SuppressStartupBanner = _True; - break; - case 0x695e9f4: // /no_robust - ValidateAllParameters = _False; - break; - case 0x3656b22: // /notlb - GenerateTypeLibrary = _True; - break; - case 0x556dbee: // /no_warn - SuppressCompilerWarnings = _True; - break; - case 0x000035f: // /o filename - RedirectOutputAndErrors = option+3; - break; - case 0x662bb12: // /oldtlb - TypeLibFormat = "OldFormat"; - break; - case 0x00366c4: // /out directory - OutputDirectory = option+5; - break; - case 0x36796f9: // /proxy filename - ProxyFileName = option+7; - break; - case 0x6959c94: // /robust - ValidateAllParameters = _True; - break; - case 0x69c9cf2: // /server {none|stub} - if(*(option+8) == 's') - GenerateServerFiles = "Stub"; - else - GenerateServerFiles = "None"; - break; - case 0x36aabb2: // /sstub filename - ServerStubFile = option+7; - break; - case 0x0036b22: // /tlb filename - TypeLibraryName = option+5; - break; - case 0x36e0162: // /win32 - TargetEnvironment = "Win32"; - break; - case 0x36e0194: // /win64 - TargetEnvironment = "Itanium"; - break; - case 0x0003459: // /Oi - case 0x00345f3: // /Oic - case 0x0003463: // /Os - case 0x0003513: // /Zs - case 0x0035796: // /acf filename - case 0x3595cf4: // /c_ext - case 0xa64d3dd: // /confirm - case 0xa765b64: // /cpp_cmd cmd_line - case 0x03629f4: // /lcid - case 0x6495cc4: // /ms_ext - case 0x96c7a1e: // /ms_union - case 0x4996fa2: // /msc_ver <nnnn> - case 0x6555a40: // /no_cpp - case 0xf64d6a6: // /no_default_epv - case 0x6dd9384: // /no_format_opt - case 0x3655a70: // /nocpp - case 0x2b455a3: // /oldnames - case 0x0036696: // /osf - case 0x036679b: // /pack {N} - case 0x678bd38: // /prefix {all|client|server|switch} - case 0x96b702c: // /protocol {all|dce|ndr64} - case 0x3696aa3: // /rpcss - case 0x698ca60: // /savePP - case 0xce9b12b: // /syntax_check - case 0xc9b5f16: // /use_epv - AdditionalOptions += option; - break; - default: - // /W{0|1|2|3|4} case - if(*(option+1) == 'W') { - switch (*(option+2)) { - case '0': - WarningLevel = "0"; - break; - case '1': - WarningLevel = "1"; - break; - case '2': - WarningLevel = "2"; - break; - case '3': - WarningLevel = "3"; - break; - case '4': - WarningLevel = "4"; - break; - default: - found = false; - } - } - break; - } - if(!found) - warn_msg(WarnLogic, "Could not parse MIDL option: %s", option); - return true; -} - -// VCLibrarianTool -------------------------------------------------- -VCXLibrarianTool::VCXLibrarianTool() - : IgnoreAllDefaultLibraries(unset), - LinkTimeCodeGeneration(unset), - SuppressStartupBanner(_True), - TreatLibWarningAsErrors(unset), - Verbose(unset) -{ -} - -// VCCustomBuildTool ------------------------------------------------ -VCXCustomBuildTool::VCXCustomBuildTool() -{ - ToolName = "VCXCustomBuildTool"; -} - -// VCResourceCompilerTool ------------------------------------------- -VCXResourceCompilerTool::VCXResourceCompilerTool() - : IgnoreStandardIncludePath(unset), - NullTerminateStrings(unset), - ShowProgress(unset), - SuppressStartupBanner(unset) -{ - PreprocessorDefinitions = QStringList("NDEBUG"); -} - -// VCXDeploymentTool -------------------------------------------- -VCXDeploymentTool::VCXDeploymentTool() -{ - DeploymentTag = "DeploymentTool"; - RemoteDirectory = ""; -} - -// VCXPostBuildEventTool --------------------------------------------- -VCXPostBuildEventTool::VCXPostBuildEventTool() -{ - EventName = "PostBuildEvent"; -} - -// VCXPreBuildEventTool ---------------------------------------------- -VCXPreBuildEventTool::VCXPreBuildEventTool() -{ - EventName = "PreBuildEvent"; -} - -// VCXPreLinkEventTool ----------------------------------------------- -VCXPreLinkEventTool::VCXPreLinkEventTool() -{ - EventName = "PreLinkEvent"; -} - -// VCConfiguration -------------------------------------------------- - -VCXConfiguration::VCXConfiguration() - : ATLMinimizesCRunTimeLibraryUsage(unset), - BuildBrowserInformation(unset), - RegisterOutput(unset), - WholeProgramOptimization(unset) -{ - compiler.config = this; - linker.config = this; - idl.config = this; -} - -// VCXFilter --------------------------------------------------------- -VCXFilter::VCXFilter() - : ParseFiles(unset), - Config(0) -{ - useCustomBuildTool = false; - useCompilerTool = false; -} - -void VCXFilter::addFile(const QString& filename) -{ - Files += VCXFilterFile(filename); -} - -void VCXFilter::addFile(const VCXFilterFile& fileInfo) -{ - Files += VCXFilterFile(fileInfo); -} - -void VCXFilter::addFiles(const QStringList& fileList) -{ - for (int i = 0; i < fileList.count(); ++i) - addFile(fileList.at(i)); -} - -void VCXFilter::modifyPCHstage(QString str) -{ - bool autogenSourceFile = Project->autogenPrecompCPP; - bool pchThroughSourceFile = !Project->precompCPP.isEmpty(); - bool isCFile = false; - for (QStringList::Iterator it = Option::c_ext.begin(); it != Option::c_ext.end(); ++it) { - if (str.endsWith(*it)) { - isCFile = true; - break; - } - } - bool isHFile = str.endsWith(".h") && (str == Project->precompH); - bool isCPPFile = pchThroughSourceFile && (str == Project->precompCPP); - - if(!isCFile && !isHFile && !isCPPFile) - return; - - if(isHFile && pchThroughSourceFile) { - if (autogenSourceFile) { - useCustomBuildTool = true; - QString toFile(Project->precompCPP); - CustomBuildTool.Description = "Generating precompiled header source file '" + toFile + "' ..."; - CustomBuildTool.Outputs += toFile; - - QStringList lines; - CustomBuildTool.CommandLine += - "echo /*-------------------------------------------------------------------- >" + toFile; - lines << "* Precompiled header source file used by Visual Studio.NET to generate"; - lines << "* the .pch file."; - lines << "*"; - lines << "* Due to issues with the dependencies checker within the IDE, it"; - lines << "* sometimes fails to recompile the PCH file, if we force the IDE to"; - lines << "* create the PCH file directly from the header file."; - lines << "*"; - lines << "* This file is auto-generated by qmake since no PRECOMPILED_SOURCE was"; - lines << "* specified, and is used as the common stdafx.cpp. The file is only"; - lines << "* generated when creating .vcxproj project files, and is not used for"; - lines << "* command line compilations by nmake."; - lines << "*"; - lines << "* WARNING: All changes made in this file will be lost."; - lines << "--------------------------------------------------------------------*/"; - lines << "#include \"" + Project->precompHFilename + "\""; - foreach(QString line, lines) - CustomBuildTool.CommandLine += "echo " + line + ">>" + toFile; - } - return; - } - - useCompilerTool = true; - // Setup PCH options - CompilerTool.PrecompiledHeader = (isCFile ? "NotUsing" : "Create" ); - CompilerTool.PrecompiledHeaderFile = (isCPPFile ? QString("$(INHERIT)") : QString("$(NOINHERIT)")); - CompilerTool.ForcedIncludeFiles = QStringList("$(NOINHERIT)"); -} - -bool VCXFilter::addExtraCompiler(const VCXFilterFile &info) -{ - const QStringList &extraCompilers = Project->extraCompilerSources.value(info.file); - if (extraCompilers.isEmpty()) - return false; - - QString inFile = info.file; - - // is the extracompiler rule on a file with a built in compiler? - const QStringList &objectMappedFile = Project->extraCompilerOutputs[inFile]; - bool hasBuiltIn = false; - if (!objectMappedFile.isEmpty()) { - hasBuiltIn = Project->hasBuiltinCompiler(objectMappedFile.at(0)); -// qDebug("*** Extra compiler file has object mapped file '%s' => '%s'", qPrintable(inFile), qPrintable(objectMappedFile.join(" "))); - } - - CustomBuildTool.AdditionalDependencies.clear(); - CustomBuildTool.CommandLine.clear(); - CustomBuildTool.Description.clear(); - CustomBuildTool.Outputs.clear(); - CustomBuildTool.ToolPath.clear(); - CustomBuildTool.ToolName = QLatin1String(_VCCustomBuildTool); - - for (int x = 0; x < extraCompilers.count(); ++x) { - const QString &extraCompilerName = extraCompilers.at(x); - - if (!Project->verifyExtraCompiler(extraCompilerName, inFile) && !hasBuiltIn) - continue; - - // All information about the extra compiler - QString tmp_out = Project->project->first(extraCompilerName + ".output"); - QString tmp_cmd = Project->project->variables()[extraCompilerName + ".commands"].join(" "); - QString tmp_cmd_name = Project->project->variables()[extraCompilerName + ".name"].join(" "); - QStringList tmp_dep = Project->project->variables()[extraCompilerName + ".depends"]; - QString tmp_dep_cmd = Project->project->variables()[extraCompilerName + ".depend_command"].join(" "); - QStringList vars = Project->project->variables()[extraCompilerName + ".variables"]; - QStringList configs = Project->project->variables()[extraCompilerName + ".CONFIG"]; - bool combined = configs.indexOf("combine") != -1; - - QString cmd, cmd_name, out; - QStringList deps, inputs; - // Variabel replacement of output name - out = Option::fixPathToTargetOS( - Project->replaceExtraCompilerVariables(tmp_out, inFile, QString()), - false); - - // If file has built-in compiler, we've swapped the input and output of - // the command, as we in Visual Studio cannot have a Custom Buildstep on - // a file which uses a built-in compiler. We would in this case only get - // the result from the extra compiler. If 'hasBuiltIn' is true, we know - // that we're actually on the _output_file_ of the result, and we - // therefore swap inFile and out below, since the extra-compiler still - // must see it as the original way. If the result also has a built-in - // compiler, too bad.. - if (hasBuiltIn) { - out = inFile; - inFile = objectMappedFile.at(0); - } - - // Dependency for the output - if(!tmp_dep.isEmpty()) - deps = tmp_dep; - if(!tmp_dep_cmd.isEmpty()) { - // Execute dependency command, and add every line as a dep - char buff[256]; - QString dep_cmd = Project->replaceExtraCompilerVariables(tmp_dep_cmd, Option::fixPathToLocalOS(inFile, true, false), out); - if(Project->canExecute(dep_cmd)) { - if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) { - QString indeps; - while(!feof(proc)) { - int read_in = (int)fread(buff, 1, 255, proc); - if(!read_in) - break; - indeps += QByteArray(buff, read_in); - } - QT_PCLOSE(proc); - if(!indeps.isEmpty()) { - QStringList extradeps = indeps.split(QLatin1Char('\n')); - for (int i = 0; i < extradeps.count(); ++i) { - QString dd = extradeps.at(i).simplified(); - if (!dd.isEmpty()) - deps += Project->fileFixify(dd); - } - } - } - } - } - for (int i = 0; i < deps.count(); ++i) - deps[i] = Option::fixPathToTargetOS( - Project->replaceExtraCompilerVariables(deps.at(i), inFile, out), - false).trimmed(); - // Command for file - if (combined) { - // Add dependencies for each file - QStringList tmp_in = Project->project->variables()[extraCompilerName + ".input"]; - for (int a = 0; a < tmp_in.count(); ++a) { - const QStringList &files = Project->project->variables()[tmp_in.at(a)]; - for (int b = 0; b < files.count(); ++b) { - deps += Project->findDependencies(files.at(b)); - inputs += Option::fixPathToTargetOS(files.at(b), false); - } - } - deps += inputs; // input files themselves too.. - - // Replace variables for command w/all input files - // ### join gives path issues with directories containing spaces! - cmd = Project->replaceExtraCompilerVariables(tmp_cmd, - inputs.join(" "), - out); - } else { - deps += inFile; // input file itself too.. - cmd = Project->replaceExtraCompilerVariables(tmp_cmd, - inFile, - out); - } - // Name for command - if(!tmp_cmd_name.isEmpty()) { - cmd_name = Project->replaceExtraCompilerVariables(tmp_cmd_name, inFile, out); - } else { - int space = cmd.indexOf(' '); - if(space != -1) - cmd_name = cmd.left(space); - else - cmd_name = cmd; - if((cmd_name[0] == '\'' || cmd_name[0] == '"') && - cmd_name[0] == cmd_name[cmd_name.length()-1]) - cmd_name = cmd_name.mid(1,cmd_name.length()-2); - } - - // Fixify paths - for (int i = 0; i < deps.count(); ++i) - deps[i] = Option::fixPathToTargetOS(deps[i], false); - - - // Output in info.additionalFile ----------- - if (!CustomBuildTool.Description.isEmpty()) - CustomBuildTool.Description += " & "; - CustomBuildTool.Description += cmd_name; - CustomBuildTool.CommandLine += cmd.trimmed().split("\n", QString::SkipEmptyParts); - int space = cmd.indexOf(' '); - QFileInfo finf(cmd.left(space)); - if (CustomBuildTool.ToolPath.isEmpty()) - CustomBuildTool.ToolPath += Option::fixPathToTargetOS(finf.path()); - CustomBuildTool.Outputs += out; - - deps += CustomBuildTool.AdditionalDependencies; - deps += cmd.left(cmd.indexOf(' ')); - // Make sure that all deps are only once - QMap<QString, bool> uniqDeps; - for (int c = 0; c < deps.count(); ++c) { - QString aDep = deps.at(c).trimmed(); - if (!aDep.isEmpty()) - uniqDeps[aDep] = false; - } - CustomBuildTool.AdditionalDependencies = uniqDeps.keys(); - } - - // Ensure that none of the output files are also dependencies. Or else, the custom buildstep - // will be rebuild every time, even if nothing has changed. - foreach(QString output, CustomBuildTool.Outputs) { - CustomBuildTool.AdditionalDependencies.removeAll(output); - } - - useCustomBuildTool = !CustomBuildTool.CommandLine.isEmpty(); - return useCustomBuildTool; -} - -// VCXProjectSingleConfig -------------------------------------------- -VCXFilter nullVCXFilter; -VCXFilter& VCXProjectSingleConfig::filterForExtraCompiler(const QString &compilerName) -{ - for (int i = 0; i < ExtraCompilersFiles.count(); ++i) - if (ExtraCompilersFiles.at(i).Name == compilerName) - return ExtraCompilersFiles[i]; - return nullVCXFilter; -} - // Tree file generation --------------------------------------------- -void XTreeNode::generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName, VCXProject &tool, const QString &filter) { +void XTreeNode::generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName, VCProject &tool, const QString &filter) { if (children.size()) { // Filter @@ -2181,7 +343,7 @@ void XTreeNode::generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString // Flat file generation --------------------------------------------- -void XFlatNode::generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &/*tagName*/, VCXProject &tool, const QString &filter) { +void XFlatNode::generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &/*tagName*/, VCProject &tool, const QString &filter) { if (children.size()) { ChildrenMapFlat::ConstIterator it = children.constBegin(); ChildrenMapFlat::ConstIterator end = children.constEnd(); @@ -2195,7 +357,7 @@ void XFlatNode::generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString } } -void VCXProjectWriter::write(XmlOutput &xml, VCXProjectSingleConfig &tool) +void VCXProjectWriter::write(XmlOutput &xml, VCProjectSingleConfig &tool) { xml.setIndentString(" "); @@ -2262,10 +424,10 @@ void VCXProjectWriter::write(XmlOutput &xml, VCXProjectSingleConfig &tool) << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.Configuration.Name)) << valueTag(tool.Configuration.IntermediateDirectory); } - if ( !tool.Configuration.TargetName.isEmpty() ) { + if ( !tool.Configuration.PrimaryOutput.isEmpty() ) { xml<< tag("TargetName") << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.Configuration.Name)) - << valueTag(tool.Configuration.TargetName); + << valueTag(tool.Configuration.PrimaryOutput); } if ( tool.Configuration.linker.IgnoreImportLibrary != unset) { @@ -2274,31 +436,32 @@ void VCXProjectWriter::write(XmlOutput &xml, VCXProjectSingleConfig &tool) << valueTagT(tool.Configuration.linker.IgnoreImportLibrary); } - if ( tool.Configuration.linker.LinkIncremental != unset) { + if ( tool.Configuration.linker.LinkIncremental != linkIncrementalDefault) { + const triState ts = (tool.Configuration.linker.LinkIncremental == linkIncrementalYes ? _True : _False); xml<< tag("LinkIncremental") << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.Configuration.Name)) - << valueTagT(tool.Configuration.linker.LinkIncremental); + << valueTagT(ts); } - if ( tool.Configuration.preBuild.UseInBuild != unset ) + if ( tool.Configuration.preBuild.ExcludedFromBuild != unset ) { xml<< tag("PreBuildEventUseInBuild") << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.Configuration.Name)) - << valueTagT(tool.Configuration.preBuild.UseInBuild); + << valueTagT(!tool.Configuration.preBuild.ExcludedFromBuild); } - if ( tool.Configuration.preLink.UseInBuild != unset ) + if ( tool.Configuration.preLink.ExcludedFromBuild != unset ) { xml<< tag("PreLinkEventUseInBuild") << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.Configuration.Name)) - << valueTagT(tool.Configuration.preLink.UseInBuild); + << valueTagT(!tool.Configuration.preLink.ExcludedFromBuild); } - if ( tool.Configuration.postBuild.UseInBuild != unset ) + if ( tool.Configuration.postBuild.ExcludedFromBuild != unset ) { xml<< tag("PostBuildEventUseInBuild") << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.Configuration.Name)) - << valueTagT(tool.Configuration.postBuild.UseInBuild); + << valueTagT(!tool.Configuration.postBuild.ExcludedFromBuild); } xml << closetag(); @@ -2318,15 +481,15 @@ void VCXProjectWriter::write(XmlOutput &xml, VCXProjectSingleConfig &tool) write(xml, tool.Configuration.resource); // Post build event - if ( tool.Configuration.postBuild.UseInBuild != unset ) + if ( tool.Configuration.postBuild.ExcludedFromBuild != unset ) write(xml, tool.Configuration.postBuild); // Pre build event - if ( tool.Configuration.preBuild.UseInBuild != unset ) + if ( tool.Configuration.preBuild.ExcludedFromBuild != unset ) write(xml, tool.Configuration.preBuild); // Pre link event - if ( tool.Configuration.preLink.UseInBuild != unset ) + if ( tool.Configuration.preLink.ExcludedFromBuild != unset ) write(xml, tool.Configuration.preLink); xml << closetag(); @@ -2346,7 +509,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCXProjectSingleConfig &tool) xmlFilter << tag("ItemGroup"); - VCXProject tempProj; + VCProject tempProj; tempProj.SingleProjects += tool; addFilters(tempProj, xmlFilter, "Form Files"); @@ -2377,7 +540,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCXProjectSingleConfig &tool) << closetag(); } -void VCXProjectWriter::write(XmlOutput &xml, VCXProject &tool) +void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool) { if (tool.SingleProjects.count() == 0) { warn_msg(WarnLogic, "Generator: .NET: no single project in merge project, no output"); @@ -2452,10 +615,10 @@ void VCXProjectWriter::write(XmlOutput &xml, VCXProject &tool) << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.SingleProjects.at(i).Configuration.Name)) << valueTag(tool.SingleProjects.at(i).Configuration.IntermediateDirectory); } - if ( !tool.SingleProjects.at(i).Configuration.TargetName.isEmpty() ) { + if ( !tool.SingleProjects.at(i).Configuration.PrimaryOutput.isEmpty() ) { xml << tag("TargetName") << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.SingleProjects.at(i).Configuration.Name)) - << valueTag(tool.SingleProjects.at(i).Configuration.TargetName); + << valueTag(tool.SingleProjects.at(i).Configuration.PrimaryOutput); } if ( tool.SingleProjects.at(i).Configuration.linker.IgnoreImportLibrary != unset) { @@ -2465,30 +628,31 @@ void VCXProjectWriter::write(XmlOutput &xml, VCXProject &tool) } if ( tool.SingleProjects.at(i).Configuration.linker.LinkIncremental != unset) { + const triState ts = (tool.SingleProjects.at(i).Configuration.linker.LinkIncremental == linkIncrementalYes ? _True : _False); xml << tag("LinkIncremental") << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.SingleProjects.at(i).Configuration.Name)) - << valueTagT(tool.SingleProjects.at(i).Configuration.linker.LinkIncremental); + << valueTagT(ts); } - if ( tool.SingleProjects.at(i).Configuration.preBuild.UseInBuild != unset ) + if ( tool.SingleProjects.at(i).Configuration.preBuild.ExcludedFromBuild != unset ) { xml << tag("PreBuildEventUseInBuild") << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.SingleProjects.at(i).Configuration.Name)) - << valueTagT(tool.SingleProjects.at(i).Configuration.preBuild.UseInBuild); + << valueTagT(!tool.SingleProjects.at(i).Configuration.preBuild.ExcludedFromBuild); } - if ( tool.SingleProjects.at(i).Configuration.preLink.UseInBuild != unset ) + if ( tool.SingleProjects.at(i).Configuration.preLink.ExcludedFromBuild != unset ) { xml << tag("PreLinkEventUseInBuild") << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.SingleProjects.at(i).Configuration.Name)) - << valueTagT(tool.SingleProjects.at(i).Configuration.preLink.UseInBuild); + << valueTagT(!tool.SingleProjects.at(i).Configuration.preLink.ExcludedFromBuild); } - if ( tool.SingleProjects.at(i).Configuration.postBuild.UseInBuild != unset ) + if ( tool.SingleProjects.at(i).Configuration.postBuild.ExcludedFromBuild != unset ) { xml << tag("PostBuildEventUseInBuild") << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.SingleProjects.at(i).Configuration.Name)) - << valueTagT(tool.SingleProjects.at(i).Configuration.postBuild.UseInBuild); + << valueTagT(!tool.SingleProjects.at(i).Configuration.postBuild.ExcludedFromBuild); } } xml << closetag(); @@ -2510,15 +674,15 @@ void VCXProjectWriter::write(XmlOutput &xml, VCXProject &tool) write(xml, tool.SingleProjects.at(i).Configuration.resource); // Post build event - if ( tool.SingleProjects.at(i).Configuration.postBuild.UseInBuild != unset ) + if ( tool.SingleProjects.at(i).Configuration.postBuild.ExcludedFromBuild != unset ) write(xml, tool.SingleProjects.at(i).Configuration.postBuild); // Pre build event - if ( tool.SingleProjects.at(i).Configuration.preBuild.UseInBuild != unset ) + if ( tool.SingleProjects.at(i).Configuration.preBuild.ExcludedFromBuild != unset ) write(xml, tool.SingleProjects.at(i).Configuration.preBuild); // Pre link event - if ( tool.SingleProjects.at(i).Configuration.preLink.UseInBuild != unset ) + if ( tool.SingleProjects.at(i).Configuration.preLink.ExcludedFromBuild != unset ) write(xml, tool.SingleProjects.at(i).Configuration.preLink); xml << closetag(); @@ -2568,83 +732,570 @@ void VCXProjectWriter::write(XmlOutput &xml, VCXProject &tool) << closetag(); } -void VCXProjectWriter::write(XmlOutput &xml, const VCXCLCompilerTool &tool) +static inline QString toString(asmListingOption option) +{ + switch (option) { + case asmListingAsmMachine: + return "AssemblyAndMachineCode"; + case asmListingAsmMachineSrc: + return "All"; + case asmListingAsmSrc: + return "AssemblyAndSourceCode"; + case asmListingAssemblyOnly: + return "AssemblyCode"; + } + return QString(); +} + +static inline QString toString(basicRuntimeCheckOption option) +{ + switch (option) { + case runtimeBasicCheckNone: + return ""; + case runtimeCheckStackFrame: + return "StackFrameRuntimeCheck"; + case runtimeCheckUninitVariables: + return "UninitializedLocalUsageCheck"; + case runtimeBasicCheckAll: + return "EnableFastChecks"; + } + return QString(); +} + +static inline QString toString(callingConventionOption option) +{ + switch (option) { + case callConventionCDecl: + return "Cdecl"; + case callConventionFastCall: + return "FastCall"; + case callConventionStdCall: + return "StdCall"; + } + return QString(); +} + +static inline QString toString(CompileAsOptions option) +{ + switch (option) { + case compileAsC: + return "CompileAsC"; + case compileAsCPlusPlus: + return "CompileAsCpp"; + } + return QString(); +} + +static inline QString toString(compileAsManagedOptions option) +{ + switch (option) { + case managedAssembly: + return "true"; + case managedAssemblyPure: + return "Safe"; + case managedAssemblyOldSyntax: + return "OldSyntax"; + } + return QString(); +} + +static inline QString toString(debugOption option) +{ + switch (option) { + case debugOldStyleInfo: + return "OldStyle"; + case debugEditAndContinue: + return "EditAndContinue"; + case debugEnabled: + return "ProgramDatabase"; + } + return QString(); +} + +static inline QString toString(enhancedInstructionSetOption option) +{ + switch (option) { + case archSSE: + return "StreamingSIMDExtensions"; + case archSSE2: + return "StreamingSIMDExtensions2"; + } + return QString(); +} + +static inline QString toString(exceptionHandling option) +{ + switch (option) { + case ehNone: + return "false"; + case ehNoSEH: + return "Sync"; + case ehSEH: + return "Async"; + } + return QString(); +} + +static inline QString toString(favorSizeOrSpeedOption option) +{ + switch (option) { + case favorSize: + return "Size"; + case favorSpeed: + return "Speed"; + } + return QString(); +} + +static inline QString toString(floatingPointModel option) +{ + switch (option) { + case floatingPointFast: + return "Fast"; + case floatingPointPrecise: + return "Precise"; + case floatingPointStrict: + return "Strict"; + } + return QString(); +} + +static inline QString toString(inlineExpansionOption option) +{ + switch (option) { + case expandDisable: + return "Disabled"; + case expandOnlyInline: + return "OnlyExplicitInline"; + case expandAnySuitable: + return "AnySuitable"; + } + return QString(); +} + +static inline QString toString(optimizeOption option) +{ + switch (option) { + case optimizeMinSpace: + return "MinSpace"; + case optimizeMaxSpeed: + return "MaxSpeed"; + } + return QString(); +} + +static inline QString toString(pchOption option) +{ + switch (option) { + case pchNone: + return "NotUsing"; + case pchCreateUsingSpecific: + return "Create"; + case pchUseUsingSpecific: + return "Use"; + } + return QString(); +} + +static inline QString toString(runtimeLibraryOption option) +{ + switch (option) { + case rtMultiThreaded: + return "MultiThreaded"; + case rtMultiThreadedDLL: + return "MultiThreadedDLL"; + case rtMultiThreadedDebug: + return "MultiThreadedDebug"; + case rtMultiThreadedDebugDLL: + return "MultiThreadedDebugDLL"; + } + return QString(); +} + +static inline QString toString(structMemberAlignOption option) +{ + switch (option) { + case alignSingleByte: + return "1Byte"; + case alignTwoBytes: + return "2Bytes"; + case alignFourBytes: + return "4Bytes"; + case alignEightBytes: + return "8Bytes"; + case alignSixteenBytes: + return "16Bytes"; + } + return QString(); +} + +static inline QString toString(warningLevelOption option) +{ + switch (option) { + case warningLevel_0: + return "TurnOffAllWarnings"; + case warningLevel_1: + return "Level1"; + case warningLevel_2: + return "Level2"; + case warningLevel_3: + return "Level3"; + case warningLevel_4: + return "Level4"; + } + return QString(); +} + +static inline QString toString(optLinkTimeCodeGenType option) +{ + switch (option) { + case optLTCGEnabled: + return "UseLinkTimeCodeGeneration"; + case optLTCGInstrument: + return "PGInstrument"; + case optLTCGOptimize: + return "PGOptimization"; + case optLTCGUpdate: + return "PGUpdate"; + } + return QString(); +} + +static inline QString toString(subSystemOption option) +{ + switch (option) { + case subSystemConsole: + return "Console"; + case subSystemWindows: + return "Windows"; + case optLTCGOptimize: + return "PGOptimization"; + case optLTCGUpdate: + return "PGUpdate"; + } + return QString(); +} + +static inline QString toString(machineTypeOption option) +{ + switch (option) { + case machineX86: + return "MachineX86"; + case machineX64: + return "MachineX64"; + } + return QString(); +} + +static inline QString toString(midlCharOption option) +{ + switch (option) { + case midlCharUnsigned: + return "Unsigned"; + case midlCharSigned: + return "Signed"; + case midlCharAscii7: + return "Ascii"; + } + return QString(); +} + +static inline QString toString(midlErrorCheckOption option) +{ + switch (option) { + case midlDisableAll: + return "None"; + case midlEnableAll: + return "All"; + } + return QString(); +} + +static inline QString toString(midlStructMemberAlignOption option) +{ + switch (option) { + case midlAlignSingleByte: + return "1"; + case midlAlignTwoBytes: + return "2"; + case midlAlignFourBytes: + return "4"; + case midlAlignEightBytes: + return "8"; + case midlAlignSixteenBytes: + return "16"; + } + return QString(); +} + +static inline QString toString(midlTargetEnvironment option) +{ + switch (option) { + case midlTargetWin32: + return "Win32"; + case midlTargetWin64: + return "X64"; + } + return QString(); +} + +static inline QString toString(midlWarningLevelOption option) +{ + switch (option) { + case midlWarningLevel_0: + return "0"; + case midlWarningLevel_1: + return "1"; + case midlWarningLevel_2: + return "2"; + case midlWarningLevel_3: + return "3"; + case midlWarningLevel_4: + return "4"; + } + return QString(); +} + +static inline QString toString(enumResourceLangID option) +{ + if (option == 0) + return QString(); + else + return QString::number(qlonglong(option)); +} + +static inline QString toString(charSet option) +{ + switch (option) { + case charSetNotSet: + return "NotSet"; + case charSetUnicode: + return "Unicode"; + case charSetMBCS: + return "MultiByte"; + } + return QString(); +} + +static inline QString toString(ConfigurationTypes option) +{ + switch (option) { + case typeApplication: + return "Application"; + case typeDynamicLibrary: + return "DynamicLibrary"; + case typeStaticLibrary: + return "StaticLibrary"; + } + return QString(); +} + +static inline QString toString(useOfATL option) +{ + switch (option) { + case useATLStatic: + return "Static"; + case useATLDynamic: + return "Dynamic"; + } + return QString(); +} + +static inline QString toString(useOfMfc option) +{ + switch (option) { + case useMfcStatic: + return "Static"; + case useMfcDynamic: + return "Dynamic"; + } + return QString(); +} + +static inline triState toTriState(browseInfoOption option) +{ + switch (option) + { + case brInfoNone: + return _False; + case brAllInfo: + case brNoLocalSymbols: + return _True; + } + return unset; +} + +static inline triState toTriState(preprocessOption option) +{ + switch (option) + { + case preprocessNo: + return _False; + case preprocessNoLineNumbers: + case preprocessYes: + return _True; + } + return unset; +} + +static inline triState toTriState(optFoldingType option) +{ + switch (option) + { + case optNoFolding: + return _False; + case optFolding: + return _True; + } + return unset; +} + +static inline triState toTriState(addressAwarenessType option) +{ + switch (option) + { + case addrAwareDefault: + return unset; + case addrAwareNoLarge: + return _False; + case addrAwareLarge: + return _True; + } + return unset; +} + +static inline triState toTriState(linkIncrementalType option) +{ + switch (option) + { + case linkIncrementalDefault: + return unset; + case linkIncrementalNo: + return _False; + case linkIncrementalYes: + return _True; + } + return unset; +} + +static inline triState toTriState(linkProgressOption option) +{ + switch (option) + { + case linkProgressNotSet: + return unset; + case linkProgressAll: + case linkProgressLibs: + return _True; + } + return unset; +} + +static inline triState toTriState(optRefType option) +{ + switch (option) + { + case optReferencesDefault: + return unset; + case optNoReferences: + return _False; + case optReferences: + return _True; + } + return unset; +} + +static inline triState toTriState(termSvrAwarenessType option) +{ + switch (option) + { + case termSvrAwareDefault: + return unset; + case termSvrAwareNo: + return _False; + case termSvrAwareYes: + return _True; + } + return unset; +} + +void VCXProjectWriter::write(XmlOutput &xml, const VCCLCompilerTool &tool) { xml << tag(_CLCompile) << attrTagX(_AdditionalIncludeDirectories, tool.AdditionalIncludeDirectories, ";") << attrTagX(_AdditionalOptions, tool.AdditionalOptions, " ") << attrTagX(_AdditionalUsingDirectories, tool.AdditionalUsingDirectories, ";") - << attrTagS(_AlwaysAppend, tool.AlwaysAppend) +//unused << attrTagS(_AlwaysAppend, tool.AlwaysAppend) << attrTagS(_AssemblerListingLocation, tool.AssemblerListingLocation) - << attrTagS(_AssemblerOutput, tool.AssemblerOutput) - << attrTagS(_BasicRuntimeChecks, tool.BasicRuntimeChecks) - << attrTagT(_BrowseInformation, tool.BrowseInformation) + << attrTagS(_AssemblerOutput, toString(tool.AssemblerOutput)) + << attrTagS(_BasicRuntimeChecks, toString(tool.BasicRuntimeChecks)) + << attrTagT(_BrowseInformation, toTriState(tool.BrowseInformation)) << attrTagS(_BrowseInformationFile, tool.BrowseInformationFile) << attrTagT(_BufferSecurityCheck, tool.BufferSecurityCheck) - << attrTagS(_CallingConvention, tool.CallingConvention) - << attrTagS(_CompileAs, tool.CompileAs) - << attrTagS(_CompileAsManaged, tool.CompileAsManaged) + << attrTagS(_CallingConvention, toString(tool.CallingConvention)) + << attrTagS(_CompileAs, toString(tool.CompileAs)) + << attrTagS(_CompileAsManaged, toString(tool.CompileAsManaged)) << attrTagT(_CreateHotpatchableImage, tool.CreateHotpatchableImage) - << attrTagS(_DebugInformationFormat, tool.DebugInformationFormat) + << attrTagS(_DebugInformationFormat, toString(tool.DebugInformationFormat)) << attrTagT(_DisableLanguageExtensions, tool.DisableLanguageExtensions) << attrTagX(_DisableSpecificWarnings, tool.DisableSpecificWarnings, ";") - << attrTagS(_EnableEnhancedInstructionSet, tool.EnableEnhancedInstructionSet) + << attrTagS(_EnableEnhancedInstructionSet, toString(tool.EnableEnhancedInstructionSet)) << attrTagT(_EnableFiberSafeOptimizations, tool.EnableFiberSafeOptimizations) << attrTagT(_EnablePREfast, tool.EnablePREfast) << attrTagS(_ErrorReporting, tool.ErrorReporting) - << attrTagS(_ExceptionHandling, tool.ExceptionHandling) + << attrTagS(_ExceptionHandling, toString(tool.ExceptionHandling)) << attrTagT(_ExpandAttributedSource, tool.ExpandAttributedSource) - << attrTagS(_FavorSizeOrSpeed, tool.FavorSizeOrSpeed) + << attrTagS(_FavorSizeOrSpeed, toString(tool.FavorSizeOrSpeed)) << attrTagT(_FloatingPointExceptions, tool.FloatingPointExceptions) - << attrTagS(_FloatingPointModel, tool.FloatingPointModel) + << attrTagS(_FloatingPointModel, toString(tool.FloatingPointModel)) << attrTagT(_ForceConformanceInForLoopScope, tool.ForceConformanceInForLoopScope) << attrTagX(_ForcedIncludeFiles, tool.ForcedIncludeFiles, ";") << attrTagX(_ForcedUsingFiles, tool.ForcedUsingFiles, ";") - << attrTagT(_FunctionLevelLinking, tool.FunctionLevelLinking) + << attrTagT(_FunctionLevelLinking, tool.EnableFunctionLevelLinking) << attrTagT(_GenerateXMLDocumentationFiles, tool.GenerateXMLDocumentationFiles) << attrTagT(_IgnoreStandardIncludePath, tool.IgnoreStandardIncludePath) - << attrTagS(_InlineFunctionExpansion, tool.InlineFunctionExpansion) - << attrTagT(_IntrinsicFunctions, tool.IntrinsicFunctions) + << attrTagS(_InlineFunctionExpansion, toString(tool.InlineFunctionExpansion)) + << attrTagT(_IntrinsicFunctions, tool.EnableIntrinsicFunctions) << attrTagT(_MinimalRebuild, tool.MinimalRebuild) << attrTagT(_MultiProcessorCompilation, tool.MultiProcessorCompilation) - << attrTagS(_ObjectFileName, tool.ObjectFileName) - << attrTagX(_ObjectFiles, tool.ObjectFiles, ";") + << attrTagS(_ObjectFileName, tool.ObjectFile) +//unused << attrTagX(_ObjectFiles, tool.ObjectFiles, ";") << attrTagT(_OmitDefaultLibName, tool.OmitDefaultLibName) << attrTagT(_OmitFramePointers, tool.OmitFramePointers) - << attrTagT(_OpenMPSupport, tool.OpenMPSupport) - << attrTagS(_Optimization, tool.Optimization) - << attrTagS(_PrecompiledHeader, tool.PrecompiledHeader) + << attrTagT(_OpenMPSupport, tool.OpenMP) + << attrTagS(_Optimization, toString(tool.Optimization)) + << attrTagS(_PrecompiledHeader, toString(tool.UsePrecompiledHeader)) << attrTagS(_PrecompiledHeaderFile, tool.PrecompiledHeaderFile) - << attrTagS(_PrecompiledHeaderOutputFile, tool.PrecompiledHeaderOutputFile) - << attrTagT(_PreprocessKeepComments, tool.PreprocessKeepComments) + << attrTagS(_PrecompiledHeaderOutputFile, tool.PrecompiledHeaderFile) + << attrTagT(_PreprocessKeepComments, tool.KeepComments) << attrTagX(_PreprocessorDefinitions, tool.PreprocessorDefinitions, ";") << attrTagS(_PreprocessOutputPath, tool.PreprocessOutputPath) << attrTagT(_PreprocessSuppressLineNumbers, tool.PreprocessSuppressLineNumbers) - << attrTagT(_PreprocessToFile, tool.PreprocessToFile) + << attrTagT(_PreprocessToFile, toTriState(tool.GeneratePreprocessedFile)) << attrTagS(_ProgramDataBaseFileName, tool.ProgramDataBaseFileName) - << attrTagS(_ProcessorNumber, tool.ProcessorNumber) - << attrTagS(_RuntimeLibrary, tool.RuntimeLibrary) + << attrTagS(_ProcessorNumber, tool.MultiProcessorCompilationProcessorCount) + << attrTagS(_RuntimeLibrary, toString(tool.RuntimeLibrary)) << attrTagT(_RuntimeTypeInfo, tool.RuntimeTypeInfo) << attrTagT(_ShowIncludes, tool.ShowIncludes) << attrTagT(_SmallerTypeCheck, tool.SmallerTypeCheck) << attrTagT(_StringPooling, tool.StringPooling) - << attrTagS(_StructMemberAlignment, tool.StructMemberAlignment) + << attrTagS(_StructMemberAlignment, toString(tool.StructMemberAlignment)) << attrTagT(_SuppressStartupBanner, tool.SuppressStartupBanner) - << attrTagS(_TreatSpecificWarningsAsErrors, tool.TreatSpecificWarningsAsErrors) - << attrTagT(_TreatWarningAsError, tool.TreatWarningAsError) +//unused << attrTagS(_TreatSpecificWarningsAsErrors, tool.TreatSpecificWarningsAsErrors) + << attrTagT(_TreatWarningAsError, tool.WarnAsError) << attrTagT(_TreatWChar_tAsBuiltInType, tool.TreatWChar_tAsBuiltInType) << attrTagT(_UndefineAllPreprocessorDefinitions, tool.UndefineAllPreprocessorDefinitions) << attrTagX(_UndefinePreprocessorDefinitions, tool.UndefinePreprocessorDefinitions, ";") - << attrTagT(_UseFullPaths, tool.UseFullPaths) + << attrTagT(_UseFullPaths, tool.DisplayFullPaths) << attrTagT(_UseUnicodeForAssemblerListing, tool.UseUnicodeForAssemblerListing) - << attrTagS(_WarningLevel, tool.WarningLevel) + << attrTagS(_WarningLevel, toString(tool.WarningLevel)) << attrTagT(_WholeProgramOptimization, tool.WholeProgramOptimization) << attrTagS(_XMLDocumentationFileName, tool.XMLDocumentationFileName) << closetag(_CLCompile); } -void VCXProjectWriter::write(XmlOutput &xml, const VCXLinkerTool &tool) +void VCXProjectWriter::write(XmlOutput &xml, const VCLinkerTool &tool) { xml << tag(_Link) @@ -2660,18 +1311,15 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCXLinkerTool &tool) << attrTagS(_CLRImageType, tool.CLRImageType) << attrTagS(_CLRSupportLastError, tool.CLRSupportLastError) << attrTagS(_CLRThreadAttribute, tool.CLRThreadAttribute) - << attrTagS(_CLRUnmanagedCodeCheck, tool.CLRUnmanagedCodeCheck) - << attrTagS(_CreateHotPatchableImage, tool.CreateHotPatchableImage) + << attrTagT(_CLRUnmanagedCodeCheck, tool.CLRUnmanagedCodeCheck) +//unused << attrTagS(_CreateHotPatchableImage, tool.CreateHotPatchableImage) << attrTagT(_DataExecutionPrevention, tool.DataExecutionPrevention) << attrTagX(_DelayLoadDLLs, tool.DelayLoadDLLs, ";") << attrTagT(_DelaySign, tool.DelaySign) - << attrTagS(_Driver, tool.Driver) - << attrTagX(_EmbedManagedResourceFile, tool.EmbedManagedResourceFile, ";") - << attrTagT(_EnableCOMDATFolding, tool.EnableCOMDATFolding) + << attrTagS(_EmbedManagedResourceFile, tool.LinkToManagedResourceFile) + << attrTagT(_EnableCOMDATFolding, toTriState(tool.EnableCOMDATFolding)) << attrTagT(_EnableUAC, tool.EnableUAC) << attrTagS(_EntryPointSymbol, tool.EntryPointSymbol) - << attrTagT(_FixedBaseAddress, tool.FixedBaseAddress) - << attrTagS(_ForceFileOutput, tool.ForceFileOutput) << attrTagX(_ForceSymbolReferences, tool.ForceSymbolReferences, ";") << attrTagS(_FunctionOrder, tool.FunctionOrder) << attrTagT(_GenerateDebugInformation, tool.GenerateDebugInformation) @@ -2682,17 +1330,16 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCXLinkerTool &tool) << attrTagT(_IgnoreAllDefaultLibraries, tool.IgnoreAllDefaultLibraries) << attrTagT(_IgnoreEmbeddedIDL, tool.IgnoreEmbeddedIDL) << attrTagT(_IgnoreImportLibrary, tool.IgnoreImportLibrary) - << attrTagX(_IgnoreSpecificDefaultLibraries, tool.IgnoreSpecificDefaultLibraries, ";") - << attrTagT(_ImageHasSafeExceptionHandlers, tool.ImageHasSafeExceptionHandlers) + << attrTagX(_IgnoreSpecificDefaultLibraries, tool.IgnoreDefaultLibraryNames, ";") << attrTagS(_ImportLibrary, tool.ImportLibrary) << attrTagS(_KeyContainer, tool.KeyContainer) << attrTagS(_KeyFile, tool.KeyFile) - << attrTagT(_LargeAddressAware, tool.LargeAddressAware) - << attrTagT(_LinkDLL, tool.LinkDLL) + << attrTagT(_LargeAddressAware, toTriState(tool.LargeAddressAware)) + << attrTagT(_LinkDLL, (tool.config->ConfigurationType == typeDynamicLibrary ? _True : unset)) << attrTagS(_LinkErrorReporting, tool.LinkErrorReporting) - << attrTagT(_LinkIncremental, tool.LinkIncremental) - << attrTagT(_LinkStatus, tool.LinkStatus) - << attrTagS(_LinkTimeCodeGeneration, tool.LinkTimeCodeGeneration) + << attrTagT(_LinkIncremental, toTriState(tool.LinkIncremental)) + << attrTagT(_LinkStatus, toTriState(tool.ShowProgress)) + << attrTagS(_LinkTimeCodeGeneration, toString(tool.LinkTimeCodeGeneration)) << attrTagS(_ManifestFile, tool.ManifestFile) << attrTagT(_MapExports, tool.MapExports) << attrTagS(_MapFileName, tool.MapFileName) @@ -2700,32 +1347,27 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCXLinkerTool &tool) << attrTagS(_MergeSections, tool.MergeSections) << attrTagS(_MidlCommandFile, tool.MidlCommandFile) << attrTagS(_ModuleDefinitionFile, tool.ModuleDefinitionFile) - << attrTagS(_MSDOSStubFileName, tool.MSDOSStubFileName) - << attrTagT(_NoEntryPoint, tool.NoEntryPoint) - << attrTagT(_OptimizeReferences, tool.OptimizeReferences) + << attrTagT(_NoEntryPoint, tool.ResourceOnlyDLL) + << attrTagT(_OptimizeReferences, toTriState(tool.OptimizeReferences)) << attrTagS(_OutputFile, tool.OutputFile) << attrTagT(_PreventDllBinding, tool.PreventDllBinding) - << attrTagS(_Profile, tool.Profile) - << attrTagS(_ProfileGuidedDatabase, tool.ProfileGuidedDatabase) << attrTagS(_ProgramDatabaseFile, tool.ProgramDatabaseFile) << attrTagT(_RandomizedBaseAddress, tool.RandomizedBaseAddress) << attrTagT(_RegisterOutput, tool.RegisterOutput) << attrTagL(_SectionAlignment, tool.SectionAlignment, /*ifNot*/ -1) << attrTagT(_SetChecksum, tool.SetChecksum) - << attrTagS(_ShowProgress, tool.ShowProgress) - << attrTagS(_SpecifySectionAttributes, tool.SpecifySectionAttributes) - << attrTagS(_StackCommitSize, tool.StackCommitSize) - << attrTagS(_StackReserveSize, tool.StackReserveSize) + << attrTagL(_StackCommitSize, tool.StackCommitSize, /*ifNot*/ -1) + << attrTagL(_StackReserveSize, tool.StackReserveSize, /*ifNot*/ -1) << attrTagS(_StripPrivateSymbols, tool.StripPrivateSymbols) - << attrTagS(_SubSystem, tool.SubSystem) - << attrTagT(_SupportNobindOfDelayLoadedDLL, tool.SupportNobindOfDelayLoadedDLL) + << attrTagS(_SubSystem, toString(tool.SubSystem)) +// << attrTagT(_SupportNobindOfDelayLoadedDLL, tool.SupportNobindOfDelayLoadedDLL) << attrTagT(_SupportUnloadOfDelayLoadedDLL, tool.SupportUnloadOfDelayLoadedDLL) << attrTagT(_SuppressStartupBanner, tool.SuppressStartupBanner) << attrTagT(_SwapRunFromCD, tool.SwapRunFromCD) << attrTagT(_SwapRunFromNet, tool.SwapRunFromNet) - << attrTagS(_TargetMachine, tool.TargetMachine) - << attrTagT(_TerminalServerAware, tool.TerminalServerAware) - << attrTagT(_TreatLinkerWarningAsErrors, tool.TreatLinkerWarningAsErrors) + << attrTagS(_TargetMachine, toString(tool.TargetMachine)) + << attrTagT(_TerminalServerAware, toTriState(tool.TerminalServerAware)) + << attrTagT(_TreatLinkerWarningAsErrors, tool.TreatWarningsAsErrors) << attrTagT(_TurnOffAssemblyGeneration, tool.TurnOffAssemblyGeneration) << attrTagS(_TypeLibraryFile, tool.TypeLibraryFile) << attrTagL(_TypeLibraryResourceID, tool.TypeLibraryResourceID, /*ifNot*/ 0) @@ -2735,7 +1377,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCXLinkerTool &tool) << closetag(_Link); } -void VCXProjectWriter::write(XmlOutput &xml, const VCXMIDLTool &tool) +void VCXProjectWriter::write(XmlOutput &xml, const VCMIDLTool &tool) { xml << tag(_Midl) @@ -2743,10 +1385,10 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCXMIDLTool &tool) << attrTagX(_AdditionalOptions, tool.AdditionalOptions, " ") << attrTagT(_ApplicationConfigurationMode, tool.ApplicationConfigurationMode) << attrTagS(_ClientStubFile, tool.ClientStubFile) - << attrTagS(_CPreprocessOptions, tool.CPreprocessOptions) - << attrTagS(_DefaultCharType, tool.DefaultCharType) + << attrTagX(_CPreprocessOptions, tool.CPreprocessOptions, " ") + << attrTagS(_DefaultCharType, toString(tool.DefaultCharType)) << attrTagS(_DLLDataFileName, tool.DLLDataFileName) - << attrTagS(_EnableErrorChecks, tool.EnableErrorChecks) + << attrTagS(_EnableErrorChecks, toString(tool.EnableErrorChecks)) << attrTagT(_ErrorCheckAllocations, tool.ErrorCheckAllocations) << attrTagT(_ErrorCheckBounds, tool.ErrorCheckBounds) << attrTagT(_ErrorCheckEnumRange, tool.ErrorCheckEnumRange) @@ -2766,20 +1408,20 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCXMIDLTool &tool) << attrTagS(_ProxyFileName, tool.ProxyFileName) << attrTagS(_RedirectOutputAndErrors, tool.RedirectOutputAndErrors) << attrTagS(_ServerStubFile, tool.ServerStubFile) - << attrTagS(_StructMemberAlignment, tool.StructMemberAlignment) + << attrTagS(_StructMemberAlignment, toString(tool.StructMemberAlignment)) << attrTagT(_SuppressCompilerWarnings, tool.SuppressCompilerWarnings) << attrTagT(_SuppressStartupBanner, tool.SuppressStartupBanner) - << attrTagS(_TargetEnvironment, tool.TargetEnvironment) + << attrTagS(_TargetEnvironment, toString(tool.TargetEnvironment)) << attrTagS(_TypeLibFormat, tool.TypeLibFormat) << attrTagS(_TypeLibraryName, tool.TypeLibraryName) << attrTagX(_UndefinePreprocessorDefinitions, tool.UndefinePreprocessorDefinitions, ";") << attrTagT(_ValidateAllParameters, tool.ValidateAllParameters) << attrTagT(_WarnAsError, tool.WarnAsError) - << attrTagS(_WarningLevel, tool.WarningLevel) + << attrTagS(_WarningLevel, toString(tool.WarningLevel)) << closetag(_Midl); } -void VCXProjectWriter::write(XmlOutput &xml, const VCXCustomBuildTool &tool) +void VCXProjectWriter::write(XmlOutput &xml, const VCCustomBuildTool &tool) { // The code below offers two ways to split custom build step commands. // Normally the $$escape_expand(\n\t) is used in a project file, which is correctly translated @@ -2807,80 +1449,82 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCXCustomBuildTool &tool) cmds += cmdl; } + const QString &configName = tool.config->Name; + if ( !tool.AdditionalDependencies.isEmpty() ) { xml << tag("AdditionalInputs") - << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.ConfigName)) + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(configName)) << valueTagDefX(tool.AdditionalDependencies, "AdditionalInputs", ";"); } if( !cmds.isEmpty() ) { xml << tag("Command") - << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.ConfigName)) + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(configName)) << valueTag(cmds); } if ( !tool.Description.isEmpty() ) { xml << tag("Message") - << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.ConfigName)) + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(configName)) << valueTag(tool.Description); } if ( !tool.Outputs.isEmpty() ) { xml << tag("Outputs") - << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.ConfigName)) + << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(configName)) << valueTagDefX(tool.Outputs, "Outputs", ";"); } } -void VCXProjectWriter::write(XmlOutput &xml, const VCXLibrarianTool &tool) +void VCXProjectWriter::write(XmlOutput &xml, const VCLibrarianTool &tool) { xml << tag(_Link) << attrTagX(_AdditionalDependencies, tool.AdditionalDependencies, ";") << attrTagX(_AdditionalLibraryDirectories, tool.AdditionalLibraryDirectories, ";") << attrTagX(_AdditionalOptions, tool.AdditionalOptions, " ") - << attrTagS(_DisplayLibrary, tool.DisplayLibrary) - << attrTagS(_ErrorReporting, tool.ErrorReporting) +//unused << attrTagS(_DisplayLibrary, tool.DisplayLibrary) +//unused << attrTagS(_ErrorReporting, tool.ErrorReporting) << attrTagX(_ExportNamedFunctions, tool.ExportNamedFunctions, ";") << attrTagX(_ForceSymbolReferences, tool.ForceSymbolReferences, ";") << attrTagT(_IgnoreAllDefaultLibraries, tool.IgnoreAllDefaultLibraries) - << attrTagX(_IgnoreSpecificDefaultLibraries, tool.IgnoreSpecificDefaultLibraries, ";") - << attrTagT(_LinkTimeCodeGeneration, tool.LinkTimeCodeGeneration) + << attrTagX(_IgnoreSpecificDefaultLibraries, tool.IgnoreDefaultLibraryNames, ";") +//unused << attrTagT(_LinkTimeCodeGeneration, tool.LinkTimeCodeGeneration) << attrTagS(_ModuleDefinitionFile, tool.ModuleDefinitionFile) - << attrTagS(_Name, tool.Name) +//unused << attrTagS(_Name, tool.Name) << attrTagS(_OutputFile, tool.OutputFile) - << attrTagX(_RemoveObjects, tool.RemoveObjects, ";") - << attrTagS(_SubSystem, tool.SubSystem) +//unused << attrTagX(_RemoveObjects, tool.RemoveObjects, ";") +//unused << attrTagS(_SubSystem, tool.SubSystem) << attrTagT(_SuppressStartupBanner, tool.SuppressStartupBanner) - << attrTagS(_TargetMachine, tool.TargetMachine) - << attrTagT(_TreatLibWarningAsErrors, tool.TreatLibWarningAsErrors) - << attrTagT(_Verbose, tool.Verbose) +//unused << attrTagS(_TargetMachine, tool.TargetMachine) +//unused << attrTagT(_TreatLibWarningAsErrors, tool.TreatLibWarningAsErrors) +//unused << attrTagT(_Verbose, tool.Verbose) << closetag(_Link); } -void VCXProjectWriter::write(XmlOutput &xml, const VCXResourceCompilerTool &tool) +void VCXProjectWriter::write(XmlOutput &xml, const VCResourceCompilerTool &tool) { xml << tag(_ResourceCompile) << attrTagX(_AdditionalIncludeDirectories, tool.AdditionalIncludeDirectories, ";") - << attrTagS(_AdditionalOptions, tool.AdditionalOptions) - << attrTagS(_Culture, tool.Culture) + << attrTagX(_AdditionalOptions, tool.AdditionalOptions, " ") + << attrTagS(_Culture, toString(tool.Culture)) << attrTagT(_IgnoreStandardIncludePath, tool.IgnoreStandardIncludePath) - << attrTagT(_NullTerminateStrings, tool.NullTerminateStrings) +//unused << attrTagT(_NullTerminateStrings, tool.NullTerminateStrings) << attrTagX(_PreprocessorDefinitions, tool.PreprocessorDefinitions, ";") << attrTagS(_ResourceOutputFileName, tool.ResourceOutputFileName) - << attrTagT(_ShowProgress, tool.ShowProgress) + << attrTagT(_ShowProgress, toTriState(tool.ShowProgress)) << attrTagT(_SuppressStartupBanner, tool.SuppressStartupBanner) - << attrTagS(_TrackerLogDirectory, tool.TrackerLogDirectory) - << attrTagS(_UndefinePreprocessorDefinitions, tool.UndefinePreprocessorDefinitions) +//unused << attrTagS(_TrackerLogDirectory, tool.TrackerLogDirectory) +//unused << attrTagS(_UndefinePreprocessorDefinitions, tool.UndefinePreprocessorDefinitions) << closetag(_ResourceCompile); } -void VCXProjectWriter::write(XmlOutput &xml, const VCXEventTool &tool) +void VCXProjectWriter::write(XmlOutput &xml, const VCEventTool &tool) { xml << tag(tool.EventName) @@ -2896,7 +1540,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCDeploymentTool &tool) // SmartDevice deployment not supported in VS 2010 } -void VCXProjectWriter::write(XmlOutput &xml, const VCXConfiguration &tool) +void VCXProjectWriter::write(XmlOutput &xml, const VCConfiguration &tool) { xml << tag("PropertyGroup") << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.Name)) @@ -2904,16 +1548,16 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCXConfiguration &tool) << attrTagS(_OutputDirectory, tool.OutputDirectory) << attrTagT(_ATLMinimizesCRunTimeLibraryUsage, tool.ATLMinimizesCRunTimeLibraryUsage) << attrTagT(_BuildBrowserInformation, tool.BuildBrowserInformation) - << attrTagS(_CharacterSet, tool.CharacterSet) - << attrTagS(_ConfigurationType, tool.ConfigurationType) + << attrTagS(_CharacterSet, toString(tool.CharacterSet)) + << attrTagS(_ConfigurationType, toString(tool.ConfigurationType)) << attrTagS(_DeleteExtensionsOnClean, tool.DeleteExtensionsOnClean) << attrTagS(_ImportLibrary, tool.ImportLibrary) << attrTagS(_IntermediateDirectory, tool.IntermediateDirectory) << attrTagS(_PrimaryOutput, tool.PrimaryOutput) << attrTagS(_ProgramDatabase, tool.ProgramDatabase) << attrTagT(_RegisterOutput, tool.RegisterOutput) - << attrTagS(_UseOfATL, tool.UseOfATL) - << attrTagS(_UseOfMfc, tool.UseOfMfc) + << attrTagS(_UseOfATL, toString(tool.UseOfATL)) + << attrTagS(_UseOfMfc, toString(tool.UseOfMfc)) << attrTagT(_WholeProgramOptimization, tool.WholeProgramOptimization) << closetag(); } @@ -2925,13 +1569,13 @@ void VCXProjectWriter::write(XmlOutput &xml, VCFilter &tool) // unused in this generator } -void VCXProjectWriter::addFilters(VCXProject &project, XmlOutput &xmlFilter, const QString &filtername) +void VCXProjectWriter::addFilters(VCProject &project, XmlOutput &xmlFilter, const QString &filtername) { bool added = false; for (int i = 0; i < project.SingleProjects.count(); ++i) { - VCXFilter filter; - const VCXProjectSingleConfig &singleCfg = project.SingleProjects.at(i); + VCFilter filter; + const VCProjectSingleConfig &singleCfg = project.SingleProjects.at(i); if (filtername == "Root Files") { filter = singleCfg.RootFiles; } else if (filtername == "Source Files") { @@ -2965,7 +1609,7 @@ void VCXProjectWriter::addFilters(VCXProject &project, XmlOutput &xmlFilter, con } // outputs a given filter for all existing configurations of a project -void VCXProjectWriter::outputFilter(VCXProject &project, XmlOutput &xml, XmlOutput &xmlFilter, const QString &filtername) +void VCXProjectWriter::outputFilter(VCProject &project, XmlOutput &xml, XmlOutput &xmlFilter, const QString &filtername) { XNode *root; if (project.SingleProjects.at(0).flat_files) @@ -2977,8 +1621,8 @@ void VCXProjectWriter::outputFilter(VCXProject &project, XmlOutput &xml, XmlOutp triState parse; for (int i = 0; i < project.SingleProjects.count(); ++i) { - VCXFilter filter; - const VCXProjectSingleConfig &singleCfg = project.SingleProjects.at(i); + VCFilter filter; + const VCProjectSingleConfig &singleCfg = project.SingleProjects.at(i); if (filtername == "Root Files") { filter = singleCfg.RootFiles; } else if (filtername == "Source Files") { @@ -3020,16 +1664,16 @@ void VCXProjectWriter::outputFilter(VCXProject &project, XmlOutput &xml, XmlOutp } // Output all configurations (by filtername) for a file (by info) -// A filters config output is in VCXFilter.outputFileConfig() -void VCXProjectWriter::outputFileConfigs(VCXProject &project, XmlOutput &xml, XmlOutput &xmlFilter, const VCXFilterFile &info, const QString &filtername) +// A filters config output is in VCFilter.outputFileConfig() +void VCXProjectWriter::outputFileConfigs(VCProject &project, XmlOutput &xml, XmlOutput &xmlFilter, const VCFilterFile &info, const QString &filtername) { // We need to check if the file has any custom build step. // If there is one then it has to be included with "CustomBuild Include" bool fileAdded = false; for (int i = 0; i < project.SingleProjects.count(); ++i) { - VCXFilter filter; - const VCXProjectSingleConfig &singleCfg = project.SingleProjects.at(i); + VCFilter filter; + const VCProjectSingleConfig &singleCfg = project.SingleProjects.at(i); if (filtername == "Root Files") { filter = singleCfg.RootFiles; } else if (filtername == "Source Files") { @@ -3136,26 +1780,26 @@ void VCXProjectWriter::outputFileConfigs(VCXProject &project, XmlOutput &xml, Xm xmlFilter << closetag(); } -bool VCXProjectWriter::outputFileConfig(VCXFilter &filter, XmlOutput &xml, XmlOutput &xmlFilter, const QString &filename, const QString &filtername, bool fileAllreadyAdded) +bool VCXProjectWriter::outputFileConfig(VCFilter &filter, XmlOutput &xml, XmlOutput &xmlFilter, const QString &filename, const QString &filtername, bool fileAllreadyAdded) { bool fileAdded = false; // Clearing each filter tool filter.useCustomBuildTool = false; filter.useCompilerTool = false; - filter.CustomBuildTool = VCXCustomBuildTool(); - filter.CompilerTool = VCXCLCompilerTool(); + filter.CustomBuildTool = VCCustomBuildTool(); + filter.CompilerTool = VCCLCompilerTool(); // Unset some default options filter.CompilerTool.BufferSecurityCheck = unset; - filter.CompilerTool.DebugInformationFormat = ""; - filter.CompilerTool.ExceptionHandling = ""; + filter.CompilerTool.DebugInformationFormat = debugUnknown; + filter.CompilerTool.ExceptionHandling = ehDefault; filter.CompilerTool.ProgramDataBaseFileName.clear(); - filter.CompilerTool.RuntimeLibrary = ""; + filter.CompilerTool.RuntimeLibrary = rtUnknown; filter.CompilerTool.config = filter.Config; bool inBuild = false; - VCXFilterFile info; + VCFilterFile info; for (int i = 0; i < filter.Files.count(); ++i) { if (filter.Files.at(i).file == filename) { info = filter.Files.at(i); @@ -3179,8 +1823,6 @@ bool VCXProjectWriter::outputFileConfig(VCXFilter &filter, XmlOutput &xml, XmlOu if (filter.useCustomBuildTool) { - filter.CustomBuildTool.ConfigName = (*filter.Config).Name; - if ( !fileAllreadyAdded ) { fileAdded = true; @@ -3290,11 +1932,11 @@ bool VCXProjectWriter::outputFileConfig(VCXFilter &filter, XmlOutput &xml, XmlOu << valueTag(filter.CompilerTool.PrecompiledHeaderFile); } - if ( !filter.CompilerTool.PrecompiledHeader.isEmpty() ) { + if ( filter.CompilerTool.UsePrecompiledHeader ) { xml << tag("PrecompiledHeader") << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(filter.Config->Name)) - << valueTag(filter.CompilerTool.PrecompiledHeader); + << valueTag(toString(filter.CompilerTool.UsePrecompiledHeader)); } } } diff --git a/qmake/generators/win32/msbuild_objectmodel.h b/qmake/generators/win32/msbuild_objectmodel.h index af45330..498552e 100644 --- a/qmake/generators/win32/msbuild_objectmodel.h +++ b/qmake/generators/win32/msbuild_objectmodel.h @@ -54,519 +54,24 @@ QT_BEGIN_NAMESPACE - -class VCXConfiguration; -class VCXProject; - -class VCXCLCompilerTool : public VCToolBase -{ -public: - // Functions - VCXCLCompilerTool(); - virtual ~VCXCLCompilerTool(){} - bool parseOption(const char* option); - - // Variables - QStringList AdditionalIncludeDirectories; - QStringList AdditionalOptions; - QStringList AdditionalUsingDirectories; - QString AlwaysAppend; - QString AssemblerListingLocation; - QString AssemblerOutput; - QString BasicRuntimeChecks; - triState BrowseInformation; - QString BrowseInformationFile; - triState BufferSecurityCheck; - QString CallingConvention; - QString CompileAs; - QString CompileAsManaged; - triState CreateHotpatchableImage; - QString DebugInformationFormat; - triState DisableLanguageExtensions; - QStringList DisableSpecificWarnings; - QString EnableEnhancedInstructionSet; - triState EnableFiberSafeOptimizations; - triState EnablePREfast; - QString ErrorReporting; - QString ExceptionHandling; - triState ExpandAttributedSource; - QString FavorSizeOrSpeed; - triState FloatingPointExceptions; - QString FloatingPointModel; - triState ForceConformanceInForLoopScope; - QStringList ForcedIncludeFiles; - QStringList ForcedUsingFiles; - triState FunctionLevelLinking; - triState GenerateXMLDocumentationFiles; - triState IgnoreStandardIncludePath; - QString InlineFunctionExpansion; - triState IntrinsicFunctions; - triState MinimalRebuild; - triState MultiProcessorCompilation; - QString ObjectFileName; - QStringList ObjectFiles; - triState OmitDefaultLibName; - triState OmitFramePointers; - triState OpenMPSupport; - QString Optimization; - QString PrecompiledHeader; - QString PrecompiledHeaderFile; - QString PrecompiledHeaderOutputFile; - triState PreprocessKeepComments; - QStringList PreprocessorDefinitions; - QString PreprocessOutputPath; - triState PreprocessSuppressLineNumbers; - triState PreprocessToFile; - QString ProgramDataBaseFileName; - QString ProcessorNumber; - QString RuntimeLibrary; - triState RuntimeTypeInfo; - triState ShowIncludes; - triState SmallerTypeCheck; - triState StringPooling; - QString StructMemberAlignment; - triState SuppressStartupBanner; - QString TreatSpecificWarningsAsErrors; - triState TreatWarningAsError; - triState TreatWChar_tAsBuiltInType; - triState UndefineAllPreprocessorDefinitions; - QStringList UndefinePreprocessorDefinitions; - triState UseFullPaths; - triState UseUnicodeForAssemblerListing; - QString WarningLevel; - triState WholeProgramOptimization; - QString XMLDocumentationFileName; - - VCXConfiguration* config; -}; - -class VCXLinkerTool : public VCToolBase -{ -public: - // Functions - VCXLinkerTool(); - virtual ~VCXLinkerTool(){} - bool parseOption(const char* option); - - // Variables - QStringList AdditionalDependencies; - QStringList AdditionalLibraryDirectories; - QStringList AdditionalManifestDependencies; - QStringList AdditionalOptions; - QStringList AddModuleNamesToAssembly; - triState AllowIsolation; - triState AssemblyDebug; - QStringList AssemblyLinkResource; - QString BaseAddress; - QString CLRImageType; - QString CLRSupportLastError; - QString CLRThreadAttribute; - QString CLRUnmanagedCodeCheck; - QString CreateHotPatchableImage; - triState DataExecutionPrevention; - QStringList DelayLoadDLLs; - triState DelaySign; - QString Driver; - QStringList EmbedManagedResourceFile; - triState EnableCOMDATFolding; - triState EnableUAC; - QString EntryPointSymbol; - triState FixedBaseAddress; - QString ForceFileOutput; - QStringList ForceSymbolReferences; - QString FunctionOrder; - triState GenerateDebugInformation; - triState GenerateManifest; - triState GenerateMapFile; - qlonglong HeapCommitSize; - qlonglong HeapReserveSize; - triState IgnoreAllDefaultLibraries; - triState IgnoreEmbeddedIDL; - triState IgnoreImportLibrary; - QStringList IgnoreSpecificDefaultLibraries; - triState ImageHasSafeExceptionHandlers; - QString ImportLibrary; - QString KeyContainer; - QString KeyFile; - triState LargeAddressAware; - triState LinkDLL; - QString LinkErrorReporting; - triState LinkIncremental; - triState LinkStatus; - QString LinkTimeCodeGeneration; - QString ManifestFile; - triState MapExports; - QString MapFileName; - QString MergedIDLBaseFileName; - QString MergeSections; - QString MidlCommandFile; - QString ModuleDefinitionFile; - QString MSDOSStubFileName; - triState NoEntryPoint; - triState OptimizeReferences; - QString OutputFile; - triState PreventDllBinding; - QString Profile; - QString ProfileGuidedDatabase; - QString ProgramDatabaseFile; - triState RandomizedBaseAddress; - triState RegisterOutput; - qlonglong SectionAlignment; - triState SetChecksum; - QString ShowProgress; - QString SpecifySectionAttributes; - QString StackCommitSize; - QString StackReserveSize; - QString StripPrivateSymbols; - QString SubSystem; - triState SupportNobindOfDelayLoadedDLL; - triState SupportUnloadOfDelayLoadedDLL; - triState SuppressStartupBanner; - triState SwapRunFromCD; - triState SwapRunFromNet; - QString TargetMachine; - triState TerminalServerAware; - triState TreatLinkerWarningAsErrors; - triState TurnOffAssemblyGeneration; - QString TypeLibraryFile; - qlonglong TypeLibraryResourceID; - QString UACExecutionLevel; - triState UACUIAccess; - QString Version; - - - VCXConfiguration* config; -}; - -class VCXMIDLTool : public VCToolBase -{ -public: - // Functions - VCXMIDLTool(); - virtual ~VCXMIDLTool(){} - bool parseOption(const char* option); - - // Variables - QStringList AdditionalIncludeDirectories; - QStringList AdditionalOptions; - triState ApplicationConfigurationMode; - QString ClientStubFile; - QString CPreprocessOptions; - QString DefaultCharType; - QString DLLDataFileName; - QString EnableErrorChecks; - triState ErrorCheckAllocations; - triState ErrorCheckBounds; - triState ErrorCheckEnumRange; - triState ErrorCheckRefPointers; - triState ErrorCheckStubData; - QString GenerateClientFiles; - QString GenerateServerFiles; - triState GenerateStublessProxies; - triState GenerateTypeLibrary; - QString HeaderFileName; - triState IgnoreStandardIncludePath; - QString InterfaceIdentifierFileName; - qlonglong LocaleID; - triState MkTypLibCompatible; - QString OutputDirectory; - QStringList PreprocessorDefinitions; - QString ProxyFileName; - QString RedirectOutputAndErrors; - QString ServerStubFile; - QString StructMemberAlignment; - triState SuppressCompilerWarnings; - triState SuppressStartupBanner; - QString TargetEnvironment; - QString TypeLibFormat; - QString TypeLibraryName; - QStringList UndefinePreprocessorDefinitions; - triState ValidateAllParameters; - triState WarnAsError; - QString WarningLevel; - - VCXConfiguration* config; -}; - -class VCXLibrarianTool : public VCToolBase -{ -public: - // Functions - VCXLibrarianTool(); - virtual ~VCXLibrarianTool(){} - bool parseOption(const char*){ return false; }; - - // Variables - QStringList AdditionalDependencies; - QStringList AdditionalLibraryDirectories; - QStringList AdditionalOptions; - QString DisplayLibrary; - QString ErrorReporting; - QStringList ExportNamedFunctions; - QStringList ForceSymbolReferences; - triState IgnoreAllDefaultLibraries; - QStringList IgnoreSpecificDefaultLibraries; - triState LinkTimeCodeGeneration; - QString ModuleDefinitionFile; - QString Name; - QString OutputFile; - QStringList RemoveObjects; - QString SubSystem; - triState SuppressStartupBanner; - QString TargetMachine; - triState TreatLibWarningAsErrors; - triState Verbose; - -}; - -class VCXCustomBuildTool : public VCToolBase -{ -public: - // Functions - VCXCustomBuildTool(); - virtual ~VCXCustomBuildTool(){} - bool parseOption(const char*){ return false; }; - - // Variables - QStringList AdditionalDependencies; - QStringList CommandLine; - QString Description; - QStringList Outputs; - QString ToolName; - QString ToolPath; - QString ConfigName; -}; - -class VCXResourceCompilerTool : public VCToolBase -{ -public: - // Functions - VCXResourceCompilerTool(); - virtual ~VCXResourceCompilerTool(){} - bool parseOption(const char*){ return false; }; - - // Variables - QStringList AdditionalIncludeDirectories; - QString AdditionalOptions; - QString Culture; - triState IgnoreStandardIncludePath; - triState NullTerminateStrings; - QStringList PreprocessorDefinitions; - QString ResourceOutputFileName; - triState ShowProgress; - triState SuppressStartupBanner; - QString TrackerLogDirectory; - QString UndefinePreprocessorDefinitions; -}; - -class VCXDeploymentTool -{ -public: - // Functions - VCXDeploymentTool(); - virtual ~VCXDeploymentTool() {} - - // Variables - QString DeploymentTag; - QString RemoteDirectory; - QString AdditionalFiles; -}; - -class VCXEventTool : public VCToolBase -{ -protected: - // Functions - VCXEventTool() : UseInBuild(unset){}; - virtual ~VCXEventTool(){} - bool parseOption(const char*){ return false; }; - -public: - // Variables - QString CommandLine; - QString Description; - triState UseInBuild; - QString EventName; - QString ToolPath; -}; - -class VCXPostBuildEventTool : public VCXEventTool -{ -public: - VCXPostBuildEventTool(); - ~VCXPostBuildEventTool(){} -}; - -class VCXPreBuildEventTool : public VCXEventTool -{ -public: - VCXPreBuildEventTool(); - ~VCXPreBuildEventTool(){} -}; - -class VCXPreLinkEventTool : public VCXEventTool -{ -public: - VCXPreLinkEventTool(); - ~VCXPreLinkEventTool(){} -}; - -class VCXConfiguration -{ -public: - // Functions - VCXConfiguration(); - ~VCXConfiguration(){} - - // Variables - triState ATLMinimizesCRunTimeLibraryUsage; - triState BuildBrowserInformation; - QString CharacterSet; - QString ConfigurationType; - QString DeleteExtensionsOnClean; - QString ImportLibrary; - QString IntermediateDirectory; - QString Name; - QString ConfigurationName; - QString OutputDirectory; - QString PrimaryOutput; - QString ProgramDatabase; - triState RegisterOutput; - QString TargetName; - QString UseOfATL; - QString UseOfMfc; - triState WholeProgramOptimization; - - // XML sub-parts - VCXCLCompilerTool compiler; - VCXLibrarianTool librarian; - VCXLinkerTool linker; - VCXMIDLTool idl; - VCXResourceCompilerTool resource; - VCXCustomBuildTool custom; - VCXDeploymentTool deployment; // Not likely to be supported: http://msdn.microsoft.com/en-us/library/sa69he4t.aspx - VCXPostBuildEventTool postBuild; - VCXPreBuildEventTool preBuild; - VCXPreLinkEventTool preLink; -}; - -struct VCXFilterFile -{ - VCXFilterFile() - { excludeFromBuild = false; } - VCXFilterFile(const QString &filename, bool exclude = false ) - { file = filename; excludeFromBuild = exclude; } - VCXFilterFile(const QString &filename, const QString &additional, bool exclude = false ) - { file = filename; excludeFromBuild = exclude; additionalFile = additional; } - bool operator==(const VCXFilterFile &other){ - return file == other.file - && additionalFile == other.additionalFile - && excludeFromBuild == other.excludeFromBuild; - } - - bool excludeFromBuild; - QString file; - QString additionalFile; // For tools like MOC -}; - -class VcxprojGenerator; -class VCXFilter -{ -public: - // Functions - VCXFilter(); - ~VCXFilter(){}; - - void addFile(const QString& filename); // equal - void addFile(const VCXFilterFile& fileInfo);// equal - void addFiles(const QStringList& fileList);// equal - bool addExtraCompiler(const VCXFilterFile &info); //equal - void modifyPCHstage(QString str); //almost equal -> file comment .vcxproj, PrecompiledHeader property - - // Variables - QString Name; - QString Filter; - QString Guid; - triState ParseFiles; - VcxprojGenerator* Project; - VCXConfiguration* Config; - QList<VCXFilterFile> Files; - - customBuildCheck CustomBuild; - - bool useCustomBuildTool; - VCXCustomBuildTool CustomBuildTool; - - bool useCompilerTool; - VCXCLCompilerTool CompilerTool; -}; - -typedef QList<VCXFilter> VCXFilterList; -class VCXProjectSingleConfig -{ -public: - enum FilterTypes { - None, - Source, - Header, - Generated, - LexYacc, - Translation, - Resources, - Extras - }; - // Functions - VCXProjectSingleConfig(){}; - ~VCXProjectSingleConfig(){} - - // Variables - QString Name; - QString Version; - QString ProjectGUID; - QString Keyword; - QString SccProjectName; - QString SccLocalPath; - QString PlatformName; - - // XML sub-parts - VCXConfiguration Configuration; - VCXFilter RootFiles; - VCXFilter SourceFiles; - VCXFilter HeaderFiles; - VCXFilter GeneratedFiles; - VCXFilter LexYaccFiles; - VCXFilter TranslationFiles; - VCXFilter FormFiles; - VCXFilter ResourceFiles; - VCXFilterList ExtraCompilersFiles; - - bool flat_files; - - // Accessor for extracompilers - VCXFilter &filterForExtraCompiler(const QString &compilerName); - // ### this function is the same as in VCProjectSingleConfig ----> DIE DIE DIE -}; - - - // Tree & Flat view of files -------------------------------------------------- -class VCXFilter; class XNode { public: virtual ~XNode() { } - void addElement(const VCXFilterFile &file) { + void addElement(const VCFilterFile &file) { addElement(file.file, file); } - virtual void addElement(const QString &filepath, const VCXFilterFile &allInfo) = 0; + virtual void addElement(const QString &filepath, const VCFilterFile &allInfo) = 0; virtual void removeElements()= 0; - virtual void generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName, VCXProject &tool, const QString &filter) = 0; + virtual void generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName, VCProject &tool, const QString &filter) = 0; virtual bool hasElements() = 0; }; class XTreeNode : public XNode { typedef QMap<QString, XTreeNode*> ChildrenMap; - VCXFilterFile info; + VCFilterFile info; ChildrenMap children; public: @@ -582,7 +87,7 @@ public: return Uindex; } - void addElement(const QString &filepath, const VCXFilterFile &allInfo){ + void addElement(const QString &filepath, const VCFilterFile &allInfo){ QString newNodeName(filepath); int index = pathIndex(filepath); @@ -609,7 +114,7 @@ public: children.clear(); } - void generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName, VCXProject &tool, const QString &filter); + void generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName, VCProject &tool, const QString &filter); bool hasElements() { return children.size() != 0; } @@ -617,7 +122,7 @@ public: class XFlatNode : public XNode { - typedef QMap<QString, VCXFilterFile> ChildrenMapFlat; + typedef QMap<QString, VCFilterFile> ChildrenMapFlat; ChildrenMapFlat children; public: @@ -633,7 +138,7 @@ public: return Uindex; } - void addElement(const QString &filepath, const VCXFilterFile &allInfo){ + void addElement(const QString &filepath, const VCFilterFile &allInfo){ QString newKey(filepath); int index = pathIndex(filepath); @@ -649,55 +154,34 @@ public: children.clear(); } - void generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName, VCXProject &proj, const QString &filter); + void generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName, VCProject &proj, const QString &filter); bool hasElements() { return children.size() != 0; } }; -// ---------------------------------------------------------------------------- - -class VCXProject -{ -public: - // Variables - QString Name; - QString Version; - QString ProjectGUID; - QString Keyword; - QString SccProjectName; - QString SccLocalPath; - QString PlatformName; - - // Single projects - QList<VCXProjectSingleConfig> SingleProjects; - - // List of all extracompilers - QStringList ExtraCompilers; -}; class VCXProjectWriter : public VCProjectWriter { public: - // ### replace the X classes with the standard names! - void write(XmlOutput &, VCXProjectSingleConfig &); - void write(XmlOutput &, VCXProject &); + void write(XmlOutput &, VCProjectSingleConfig &); + void write(XmlOutput &, VCProject &); - void write(XmlOutput &, const VCXCLCompilerTool &); - void write(XmlOutput &, const VCXLinkerTool &); - void write(XmlOutput &, const VCXMIDLTool &); - void write(XmlOutput &, const VCXCustomBuildTool &); - void write(XmlOutput &, const VCXLibrarianTool &); - void write(XmlOutput &, const VCXResourceCompilerTool &); - void write(XmlOutput &, const VCXEventTool &); + void write(XmlOutput &, const VCCLCompilerTool &); + void write(XmlOutput &, const VCLinkerTool &); + void write(XmlOutput &, const VCMIDLTool &); + void write(XmlOutput &, const VCCustomBuildTool &); + void write(XmlOutput &, const VCLibrarianTool &); + void write(XmlOutput &, const VCResourceCompilerTool &); + void write(XmlOutput &, const VCEventTool &); void write(XmlOutput &, const VCDeploymentTool &); - void write(XmlOutput &, const VCXConfiguration &); + void write(XmlOutput &, const VCConfiguration &); void write(XmlOutput &, VCFilter &); private: - static void addFilters(VCXProject &project, XmlOutput &xmlFilter, const QString &filterName); - static void outputFilter(VCXProject &project, XmlOutput &xml, XmlOutput &xmlFilter, const QString &filtername); - static void outputFileConfigs(VCXProject &project, XmlOutput &xml, XmlOutput &xmlFilter, const VCXFilterFile &info, const QString &filtername); - static bool outputFileConfig(VCXFilter &filter, XmlOutput &xml, XmlOutput &xmlFilter, const QString &filename, const QString &filtername, bool fileAllreadyAdded); + static void addFilters(VCProject &project, XmlOutput &xmlFilter, const QString &filterName); + static void outputFilter(VCProject &project, XmlOutput &xml, XmlOutput &xmlFilter, const QString &filtername); + static void outputFileConfigs(VCProject &project, XmlOutput &xml, XmlOutput &xmlFilter, const VCFilterFile &info, const QString &filtername); + static bool outputFileConfig(VCFilter &filter, XmlOutput &xml, XmlOutput &xmlFilter, const QString &filename, const QString &filtername, bool fileAllreadyAdded); friend class XTreeNode; friend class XFlatNode; diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 1d18dc8..607de5d 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -280,6 +280,14 @@ inline XmlOutput::xml_output attrX(const char *name, const QStringList &v, const return attr(name, v.join(s)); } +triState operator!(const triState &rhs) +{ + if (rhs == unset) + return rhs; + triState lhs = (rhs == _True ? _False : _True); + return lhs; +} + // VCCLCompilerTool ------------------------------------------------- VCCLCompilerTool::VCCLCompilerTool() : AssemblerOutput(asmListingNone), @@ -305,12 +313,14 @@ VCCLCompilerTool::VCCLCompilerTool() FloatingPointExceptions(unset), ForceConformanceInForLoopScope(unset), GeneratePreprocessedFile(preprocessNo), + PreprocessSuppressLineNumbers(unset), GlobalOptimizations(unset), IgnoreStandardIncludePath(unset), ImproveFloatingPointConsistency(unset), InlineFunctionExpansion(expandDefault), KeepComments(unset), MinimalRebuild(unset), + OmitDefaultLibName(unset), OmitFramePointers(unset), OpenMP(unset), Optimization(optimizeCustom), @@ -328,11 +338,17 @@ VCCLCompilerTool::VCCLCompilerTool() TurnOffAssemblyGeneration(unset), UndefineAllPreprocessorDefinitions(unset), UsePrecompiledHeader(pchNone), + UseUnicodeForAssemblerListing(unset), WarnAsError(unset), WarningLevel(warningLevel_0), WholeProgramOptimization(unset), CompileForArchitecture(archUnknown), - InterworkCalls(unset) + InterworkCalls(unset), + EnablePREfast(unset), + DisplayFullPaths(unset), + MultiProcessorCompilation(unset), + GenerateXMLDocumentationFiles(unset), + CreateHotpatchableImage(unset) { } @@ -381,6 +397,10 @@ bool VCCLCompilerTool::parseOption(const char* option) switch (first) { case '?': case 'h': + if(second == 'o' && third == 't' && fourth == 'p') { + CreateHotpatchableImage = _True; + break; + } qWarning("Generator: Option '/?', '/help': MSVC.NET projects do not support outputting help info"); found = false; break; @@ -406,7 +426,7 @@ bool VCCLCompilerTool::parseOption(const char* option) break; case 'E': if(second == 'H') { - QString opt(option); + QByteArray opt(option + 2); if (opt.contains('a') && !opt.contains('s') && !opt.contains('c')) ExceptionHandling = ehSEH; else if (!opt.contains('a') && opt.contains("s-") && opt.contains("c-")) @@ -425,6 +445,8 @@ bool VCCLCompilerTool::parseOption(const char* option) AdditionalOptions += option; } break; + } else if (second == 'P') { + PreprocessSuppressLineNumbers = _True; } GeneratePreprocessedFile = preprocessYes; break; @@ -441,16 +463,24 @@ bool VCCLCompilerTool::parseOption(const char* option) AssemblerOutput = asmListingAsmMachineSrc; } else if(third == 's') { AssemblerOutput = asmListingAsmSrc; + } else if (third == 'u') { + UseUnicodeForAssemblerListing = _True; } else { AssemblerOutput = asmListingAssemblyOnly; } break; + case 'C': + DisplayFullPaths = _True; + break; case 'a': AssemblerListingLocation = option+3; break; case 'I': ForcedIncludeFiles += option+3; break; + case 'i': + PreprocessOutputPath += option+3; + break; case 'R': BrowseInformation = brAllInfo; BrowseInformationFile = option+3; @@ -522,6 +552,8 @@ bool VCCLCompilerTool::parseOption(const char* option) break; case 'S': BufferSecurityCheck = _True; + if(third == '-') + BufferSecurityCheck = _False; break; case 'T': EnableFiberSafeOptimizations = _True; @@ -599,10 +631,14 @@ bool VCCLCompilerTool::parseOption(const char* option) RuntimeLibrary = rtMultiThreadedDebug; break; } else if (second == 'P') { - if (config->CompilerVersion >= NET2005) + if (config->CompilerVersion >= NET2005) { AdditionalOptions += option; - else + } else if (config->CompilerVersion >= NET2010) { + MultiProcessorCompilation = _True; + MultiProcessorCompilationProcessorCount = option+3; + } else { warn_msg(WarnLogic, "/MP option is not supported in Visual C++ < 2005, ignoring."); + } break; } found = false; break; @@ -779,7 +815,12 @@ bool VCCLCompilerTool::parseOption(const char* option) break; case 'p': if(third == '6' && fourth == '4') { - Detect64BitPortabilityProblems = _True; + if (config->CompilerVersion >= NET2010) { + // Deprecated for VS2010 but can be used under Additional Options. + AdditionalOptions += option; + } else { + Detect64BitPortabilityProblems = _True; + } break; } // Fallthrough @@ -831,7 +872,7 @@ bool VCCLCompilerTool::parseOption(const char* option) DebugInformationFormat = debugEnabled; break; case 'l': - DebugInformationFormat = debugEditAndContinue; + OmitDefaultLibName = _True; break; case 'a': DisableLanguageExtensions = _True; @@ -895,6 +936,9 @@ bool VCCLCompilerTool::parseOption(const char* option) break; } } + } else if (second == 'n' && third == 'a' && fourth == 'l') { + EnablePREfast = _True; + break; } found = false; break; @@ -953,10 +997,34 @@ bool VCCLCompilerTool::parseOption(const char* option) } break; case 'd': - if(second != 'r') { - found = false; break; + if (second == 'r') { + CompileAsManaged = managedAssembly; + break; + } else if (second != 'o' && third == 'c') { + GenerateXMLDocumentationFiles = _True; + XMLDocumentationFileName += option+4; + break; } - CompileAsManaged = managedAssembly; + found = false; + break; + case 'e': + if (second == 'r' && third == 'r' && fourth == 'o') { + if (option[12] == ':') { + if ( option[13] == 'n') { + ErrorReporting = "None"; + } else if (option[13] == 'p') { + ErrorReporting = "Prompt"; + } else if (option[13] == 'q') { + ErrorReporting = "Queue"; + } else if (option[13] == 's') { + ErrorReporting = "Send"; + } else { + found = false; + } + break; + } + } + found = false; break; case 'f': if(second == 'p' && third == ':') { @@ -1039,7 +1107,8 @@ bool VCCLCompilerTool::parseOption(const char* option) // VCLinkerTool ----------------------------------------------------- VCLinkerTool::VCLinkerTool() - : EnableCOMDATFolding(optFoldingDefault), + : DataExecutionPrevention(unset), + EnableCOMDATFolding(optFoldingDefault), GenerateDebugInformation(unset), GenerateMapFile(unset), HeapCommitSize(-1), @@ -1055,6 +1124,7 @@ VCLinkerTool::VCLinkerTool() MapLines(unset), OptimizeForWindows98(optWin98Default), OptimizeReferences(optReferencesDefault), + RandomizedBaseAddress(unset), RegisterOutput(unset), ResourceOnlyDLL(unset), SetChecksum(unset), @@ -1068,8 +1138,18 @@ VCLinkerTool::VCLinkerTool() SwapRunFromNet(unset), TargetMachine(machineNotSet), TerminalServerAware(termSvrAwareDefault), + TreatWarningsAsErrors(unset), TurnOffAssemblyGeneration(unset), - TypeLibraryResourceID(0) + TypeLibraryResourceID(0), + GenerateManifest(unset), + EnableUAC(unset), + UACUIAccess(unset), + SectionAlignment(-1), + PreventDllBinding(unset), + AllowIsolation(unset), + AssemblyDebug(unset), + CLRUnmanagedCodeCheck(unset), + DelaySign(unset) { } @@ -1142,26 +1222,57 @@ bool VCLinkerTool::parseOption(const char* option) displayHash("POSIX"); displayHash("WINDOWS"); displayHash("WINDOWSCE"); displayHash("NET"); displayHash("CD"); displayHash("NO"); #endif bool found = true; - switch (elfHash(option)) { - case 0x3360dbe: // /ALIGN[:number] - case 0x1485c34: // /ALLOWBIND[:NO] + const uint optionHash = elfHash(option); + if (config->CompilerVersion < NET2010) { + switch (optionHash) { + case 0x3360dbe: // /ALIGN[:number] + case 0x1485c34: // /ALLOWBIND[:NO] + case 0x33aec94: // /FIXED[:NO] + case 0x7988f7e: // /SECTION:name,[E][R][W][S][D][K][L][P][X][,ALIGN=#] + case 0x0348992: // /STUB:filename + AdditionalOptions += option; + return true; + } + } + + switch (optionHash) { case 0x6b21972: // /DEFAULTLIB:library case 0x396ea92: // /DRIVER[:UPONLY | :WDM] case 0xaca9d75: // /EXETYPE[:DYNAMIC | :DEV386] case 0x3ad5444: // /EXPORT:entryname[,@ordinal[,NONAME]][,DATA] - case 0x33aec94: // /FIXED[:NO] case 0x33b4675: // /FORCE:[MULTIPLE|UNRESOLVED] case 0x3dc3455: // /IGNORE:number,number,number,number ### NOTE: This one is undocumented, but it is even used by Microsoft. // In recent versions of the Microsoft linker they have disabled this undocumented feature. - case 0x7988f7e: // /SECTION:name,[E][R][W][S][D][K][L][P][X][,ALIGN=#] - case 0x0348992: // /STUB:filename case 0x0034bc4: // /VXD - case 0x0034c50: // /WS AdditionalOptions += option; break; + case 0x3360dbe: // /ALIGN[:number] + SectionAlignment = QString(option+7).toLongLong(); + break; + case 0x1485c34: // /ALLOWBIND[:NO] + if(*(option+10) == ':' && (*(option+11) == 'n' || *(option+11) == 'N')) + PreventDllBinding = _False; + else + PreventDllBinding = _True; + break; + case 0x312011e: // /ALLOWISOLATION[:NO] + if(*(option+15) == ':' && (*(option+16) == 'n' || *(option+16) == 'N')) + AllowIsolation = _False; + else + AllowIsolation = _True; + break; case 0x679c075: // /ASSEMBLYMODULE:filename AddModuleNamesToAssembly += option+15; break; + case 0x75f35f7: // /ASSEMBLYDEBUG[:DISABLE] + if(*(option+14) == ':' && (*(option+15) == 'D')) + AssemblyDebug = _False; + else + AssemblyDebug = _True; + break; + case 0x43294a5: // /ASSEMBLYLINKRESOURCE:filename + AssemblyLinkResource += option+22; + break; case 0x062d065: // /ASSEMBLYRESOURCE:filename LinkToManagedResourceFile = option+18; break; @@ -1171,6 +1282,71 @@ bool VCLinkerTool::parseOption(const char* option) // We don't use it in Qt, so keep it simple for now BaseAddress = option+6; break; + case 0x63bf065: // /CLRIMAGETYPE:{IJW|PURE|SAFE} + if(*(option+14) == 'I') + CLRImageType = "ForceIJWImage"; + else if(*(option+14) == 'P') + CLRImageType = "ForcePureILImage"; + else if(*(option+14) == 'S') + CLRImageType = "ForceSafeILImage"; + break; + case 0x5f2a6a2: // /CLRSUPPORTLASTERROR{:NO | SYSTEMDLL} + if(*(option+20) == ':') { + if(*(option+21) == 'N') { + CLRSupportLastError = "Disabled"; + } else if(*(option+21) == 'S') { + CLRSupportLastError = "SystemDlls"; + } + } else { + CLRSupportLastError = "Enabled"; + } + break; + case 0xc7984f5: // /CLRTHREADATTRIBUTE:{STA|MTA|NONE} + if(*(option+20) == 'N') + CLRThreadAttribute = "DefaultThreadingAttribute"; + else if(*(option+20) == 'M') + CLRThreadAttribute = "MTAThreadingAttribute"; + else if(*(option+20) == 'S') + CLRThreadAttribute = "STAThreadingAttribute"; + break; + case 0xa8c637b: // /CLRUNMANAGEDCODECHECK[:NO] + if(*(option+23) == 'N') + CLRUnmanagedCodeCheck = _False; + else + CLRUnmanagedCodeCheck = _True; + break; + case 0x62d9e94: // /MANIFEST[:NO] + if ((*(option+9) == ':' && (*(option+10) == 'N' || *(option+10) == 'n'))) + GenerateManifest = _False; + else + GenerateManifest = _True; + break; + case 0x8b64559: // /MANIFESTDEPENDENCY:manifest_dependency + AdditionalManifestDependencies += option+20; + break; + case 0xe9e8195: // /MANIFESTFILE:filename + ManifestFile = option+14; + break; + case 0x9e9fb83: // /MANIFESTUAC http://msdn.microsoft.com/en-us/library/bb384691%28VS.100%29.aspx + if ((*(option+12) == ':' && (*(option+13) == 'N' || *(option+13) == 'n'))) + EnableUAC = _False; + else if((*(option+12) == ':' && (*(option+13) == 'l' || *(option+14) == 'e'))) { // level + if(*(option+20) == 'a') + UACExecutionLevel = "AsInvoker"; + else if(*(option+20) == 'h') + UACExecutionLevel = "HighestAvailable"; + else if(*(option+20) == 'r') + UACExecutionLevel = "RequireAdministrator"; + } else if((*(option+12) == ':' && (*(option+13) == 'u' || *(option+14) == 'i'))) { // uiAccess + if(*(option+22) == 't') + UACUIAccess = _True; + else + UACUIAccess = _False; + } else if((*(option+12) == ':' && (*(option+13) == 'f' || *(option+14) == 'r'))) { // fragment + AdditionalOptions += option; + }else + EnableUAC = _True; + break; case 0x3389797: // /DEBUG GenerateDebugInformation = _True; break; @@ -1185,12 +1361,36 @@ bool VCLinkerTool::parseOption(const char* option) case 0x06f4bf4: // /DELAYLOAD:dllname DelayLoadDLLs += option+11; break; + case 0x06d451e: // /DELAYSIGN[:NO] + if(*(option+10) == ':' && (*(option+11) == 'n' || *(option+11) == 'N')) + DelaySign = _False; + else + DelaySign = _True; + break; case 0x003390c: // /DLL // This option is not used for vcproj files break; + case 0x2ee8415: // /DYNAMICBASE[:NO] + if(*(option+12) == ':' && (*(option+13) == 'n' || *(option+13) == 'N')) + RandomizedBaseAddress = _False; + else + RandomizedBaseAddress = _True; + break; case 0x33a3979: // /ENTRY:function EntryPointSymbol = option+7; break; + case 0x4504334: // /ERRORREPORT:[ NONE | PROMPT | QUEUE | SEND ] + if(*(option+12) == ':' ) { + if(*(option+13) == 'N') + LinkErrorReporting = "NoErrorReport"; + else if(*(option+13) == 'P') + LinkErrorReporting = "PromptImmediately"; + else if(*(option+13) == 'Q') + LinkErrorReporting = "QueueForNextLogin"; + else if(*(option+13) == 'S') + LinkErrorReporting = "SendErrorReport"; + } + break; case 0x033c960: // /HEAP:reserve[,commit] { QStringList both = QString(option+6).split(","); @@ -1218,6 +1418,12 @@ bool VCLinkerTool::parseOption(const char* option) else LinkIncremental = linkIncrementalYes; break; + case 0x07f1ab2: // /KEYCONTAINER:name + KeyContainer = option+14; + break; + case 0xfadaf35: // /KEYFILE:filename + KeyFile = option+9; + break; case 0x26e4675: // /LARGEADDRESSAWARE[:no] if(*(option+18) == ':' && *(option+19) == 'n') @@ -1322,6 +1528,12 @@ bool VCLinkerTool::parseOption(const char* option) case 0x434138f: // /NOLOGO SuppressStartupBanner = _True; break; + case 0xc841054: // /NXCOMPAT[:NO] + if ((*(option+9) == ':' && (*(option+10) == 'N' || *(option+10) == 'n'))) + DataExecutionPrevention = _False; + else + DataExecutionPrevention = _True; + break; case 0x0034454: // /OPT:{REF | NOREF | ICF[=iterations] | NOICF | WIN98 | NOWIN98} { char third = *(option+7); @@ -1399,7 +1611,7 @@ bool VCLinkerTool::parseOption(const char* option) case 0x5268ea5: // NATIVE case 0x05547e8: // POSIX case 0x2949c95: // WINDOWSCE - case 0x4B69795: // windowsce + case 0x4B69795: // windowsce AdditionalOptions += option; break; default: @@ -1438,6 +1650,16 @@ bool VCLinkerTool::parseOption(const char* option) case 0xaa77f7e: // /VERSION:major[.minor] Version = option+9; break; + case 0x0034c50: // /WS[:NO] + if (config->CompilerVersion >= NET2010) { + if(*(option+3) == ':') + TreatWarningsAsErrors = _False; + else + TreatWarningsAsErrors = _True; + } else { + AdditionalOptions += option; + } + break; default: AdditionalOptions += option; break; @@ -1467,7 +1689,11 @@ VCMIDLTool::VCMIDLTool() TargetEnvironment(midlTargetNotSet), ValidateParameters(unset), WarnAsError(unset), - WarningLevel(midlWarningLevel_0) + WarningLevel(midlWarningLevel_0), + ApplicationConfigurationMode(unset), + ValidateAllParameters(unset), + SuppressCompilerWarnings(unset), + LocaleID(-1) { } @@ -1503,7 +1729,25 @@ bool VCMIDLTool::parseOption(const char* option) #endif bool found = true; int offset = 0; - switch(elfHash(option)) { + + const uint optionHash = elfHash(option); + + if (config->CompilerVersion < NET2010) { + switch (optionHash) { + case 0x5b1cb97: // /app_config + case 0x5a2fc64: // /client {none|stub} + case 0x35aabb2: // /cstub filename + case 0x64ceb12: // /newtlb + case 0x556dbee: // /no_warn + case 0x662bb12: // /oldtlb + case 0x69c9cf2: // /server {none|stub} + case 0x36aabb2: // /sstub filename + AdditionalOptions += option; + return true; + } + } + + switch(optionHash) { case 0x0000334: // /D name[=def] PreprocessorDefinitions += option+3; break; @@ -1540,6 +1784,9 @@ bool VCMIDLTool::parseOption(const char* option) found = false; } break; + case 0x5b1cb97: // /app_config + ApplicationConfigurationMode = _True; + break; case 0x0359e82: // /char {ascii7|signed|unsigned} switch(*(option+6)) { case 'a': @@ -1555,9 +1802,18 @@ bool VCMIDLTool::parseOption(const char* option) found = false; } break; + case 0x5a2fc64: // /client {none|stub} + if(*(option+8) == 's') + GenerateClientFiles = "Stub"; + else + GenerateClientFiles = "None"; + break; case 0xa766524: // /cpp_opt options CPreprocessOptions += option+9; break; + case 0x35aabb2: // /cstub filename + ClientStubFile = option+7; + break; case 0xb32abf1: // /dlldata filename DLLDataFileName = option + 9; break; @@ -1603,18 +1859,30 @@ bool VCMIDLTool::parseOption(const char* option) case 0x64b7933: // /mktyplib203 MkTypLibCompatible = _True; break; + case 0x64ceb12: // /newtlb + TypeLibFormat = "NewFormat"; + break; case 0x8e0b0a2: // /no_def_idir IgnoreStandardIncludePath = _True; break; case 0x65635ef: // /nologo SuppressStartupBanner = _True; break; + case 0x695e9f4: // /no_robust + ValidateAllParameters = _False; + break; case 0x3656b22: // /notlb GenerateTypeLibrary = _True; break; + case 0x556dbee: // /no_warn + SuppressCompilerWarnings = _True; + break; case 0x000035f: // /o filename RedirectOutputAndErrors = option+3; break; + case 0x662bb12: // /oldtlb + TypeLibFormat = "OldFormat"; + break; case 0x00366c4: // /out directory OutputDirectory = option+5; break; @@ -1630,6 +1898,15 @@ bool VCMIDLTool::parseOption(const char* option) else TargetEnvironment = midlTargetWin32; break; + case 0x69c9cf2: // /server {none|stub} + if(*(option+8) == 's') + GenerateServerFiles = "Stub"; + else + GenerateServerFiles = "None"; + break; + case 0x36aabb2: // /sstub filename + ServerStubFile = option+7; + break; case 0x0036b22: // /tlb filename TypeLibraryName = option+5; break; @@ -1644,32 +1921,24 @@ bool VCMIDLTool::parseOption(const char* option) case 0x0003463: // /Os case 0x0003513: // /Zs case 0x0035796: // /acf filename - case 0x5b1cb97: // /app_config case 0x3595cf4: // /c_ext - case 0x5a2fc64: // /client {none|stub} case 0xa64d3dd: // /confirm case 0xa765b64: // /cpp_cmd cmd_line - case 0x35aabb2: // /cstub filename case 0x03629f4: // /lcid case 0x6495cc4: // /ms_ext case 0x96c7a1e: // /ms_union case 0x4996fa2: // /msc_ver <nnnn> - case 0x64ceb12: // /newtlb case 0x6555a40: // /no_cpp case 0xf64d6a6: // /no_default_epv case 0x6dd9384: // /no_format_opt - case 0x556dbee: // /no_warn case 0x3655a70: // /nocpp case 0x2b455a3: // /oldnames - case 0x662bb12: // /oldtlb case 0x0036696: // /osf case 0x036679b: // /pack {N} case 0x678bd38: // /prefix {all|client|server|switch} case 0x96b702c: // /protocol {all|dce|ndr64} case 0x3696aa3: // /rpcss case 0x698ca60: // /savePP - case 0x69c9cf2: // /server {none|stub} - case 0x36aabb2: // /sstub filename case 0xce9b12b: // /syntax_check case 0xc9b5f16: // /use_epv AdditionalOptions += option; @@ -1721,7 +1990,8 @@ VCCustomBuildTool::VCCustomBuildTool() VCResourceCompilerTool::VCResourceCompilerTool() : Culture(rcUseDefault), IgnoreStandardIncludePath(unset), - ShowProgress(linkProgressNotSet) + ShowProgress(linkProgressNotSet), + SuppressStartupBanner(unset) { PreprocessorDefinitions = QStringList("NDEBUG"); } @@ -1734,22 +2004,31 @@ VCDeploymentTool::VCDeploymentTool() RemoteDirectory = ""; } +VCEventTool::VCEventTool(const QString &eventName) + : ExcludedFromBuild(unset) +{ + EventName = eventName; + ToolName = "VC"; + ToolName += eventName; + ToolName += "Tool"; +} + // VCPostBuildEventTool --------------------------------------------- VCPostBuildEventTool::VCPostBuildEventTool() + : VCEventTool("PostBuildEvent") { - ToolName = "VCPostBuildEventTool"; } // VCPreBuildEventTool ---------------------------------------------- VCPreBuildEventTool::VCPreBuildEventTool() + : VCEventTool("PreBuildEvent") { - ToolName = "VCPreBuildEventTool"; } // VCPreLinkEventTool ----------------------------------------------- VCPreLinkEventTool::VCPreLinkEventTool() + : VCEventTool("PreLinkEvent") { - ToolName = "VCPreLinkEventTool"; } // VCConfiguration -------------------------------------------------- @@ -1767,6 +2046,7 @@ VCConfiguration::VCConfiguration() compiler.config = this; linker.config = this; idl.config = this; + custom.config = this; } // VCFilter --------------------------------------------------------- @@ -1830,7 +2110,9 @@ void VCFilter::modifyPCHstage(QString str) lines << "*"; lines << "* This file is auto-generated by qmake since no PRECOMPILED_SOURCE was"; lines << "* specified, and is used as the common stdafx.cpp. The file is only"; - lines << "* generated when creating .vcproj project files, and is not used for"; + lines << "* generated when creating "; + lines << (Config->CompilerVersion < NET2010 ? ".vcproj" : ".vcxproj"); + lines << " project files, and is not used for"; lines << "* command line compilations by nmake."; lines << "*"; lines << "* WARNING: All changes made in this file will be lost."; diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h index bb692b1..85c7a5c 100644 --- a/qmake/generators/win32/msvc_objectmodel.h +++ b/qmake/generators/win32/msvc_objectmodel.h @@ -86,6 +86,9 @@ enum triState { _False = 0, _True = 1 }; + +triState operator!(const triState &rhs); + enum addressAwarenessType { addrAwareDefault, addrAwareNoLarge, @@ -520,6 +523,7 @@ public: QStringList ForcedIncludeFiles; QStringList ForcedUsingFiles; preprocessOption GeneratePreprocessedFile; + triState PreprocessSuppressLineNumbers; triState GlobalOptimizations; triState IgnoreStandardIncludePath; triState ImproveFloatingPointConsistency; @@ -527,6 +531,7 @@ public: triState KeepComments; triState MinimalRebuild; QString ObjectFile; + triState OmitDefaultLibName; triState OmitFramePointers; triState OpenMP; optimizeOption Optimization; @@ -549,11 +554,24 @@ public: triState UndefineAllPreprocessorDefinitions; QStringList UndefinePreprocessorDefinitions; pchOption UsePrecompiledHeader; + triState UseUnicodeForAssemblerListing; triState WarnAsError; warningLevelOption WarningLevel; triState WholeProgramOptimization; useOfArchitecture CompileForArchitecture; triState InterworkCalls; + + // VS2010 + triState EnablePREfast; + triState DisplayFullPaths; + triState MultiProcessorCompilation; + QString MultiProcessorCompilationProcessorCount; + triState GenerateXMLDocumentationFiles; + QString XMLDocumentationFileName; + QString ErrorReporting; + triState CreateHotpatchableImage; + QString PreprocessOutputPath; + VCConfiguration* config; }; @@ -571,6 +589,7 @@ public: QStringList AdditionalOptions; QStringList AddModuleNamesToAssembly; QString BaseAddress; + triState DataExecutionPrevention; QStringList DelayLoadDLLs; optFoldingType EnableCOMDATFolding; QString EntryPointSymbol; @@ -601,6 +620,7 @@ public: optRefType OptimizeReferences; QString OutputFile; QString ProgramDatabaseFile; + triState RandomizedBaseAddress; triState RegisterOutput; triState ResourceOnlyDLL; triState SetChecksum; @@ -615,10 +635,33 @@ public: triState SwapRunFromNet; machineTypeOption TargetMachine; termSvrAwarenessType TerminalServerAware; + triState TreatWarningsAsErrors; triState TurnOffAssemblyGeneration; QString TypeLibraryFile; qlonglong TypeLibraryResourceID; QString Version; + + // VS2010 + triState GenerateManifest; + QStringList AdditionalManifestDependencies; + QString ManifestFile; + triState EnableUAC; + QString UACExecutionLevel; + triState UACUIAccess; + qlonglong SectionAlignment; + triState PreventDllBinding; + triState AllowIsolation; + triState AssemblyDebug; + QStringList AssemblyLinkResource; + QString CLRImageType; + QString CLRSupportLastError; + QString CLRThreadAttribute; + triState CLRUnmanagedCodeCheck; + triState DelaySign; + QString KeyContainer; + QString KeyFile; + QString LinkErrorReporting; + VCConfiguration* config; }; @@ -661,6 +704,18 @@ public: triState ValidateParameters; triState WarnAsError; midlWarningLevelOption WarningLevel; + + // VS 2010 + triState ApplicationConfigurationMode; + QString GenerateClientFiles; + QString ClientStubFile; + QString TypeLibFormat; + triState ValidateAllParameters; + triState SuppressCompilerWarnings; + QString GenerateServerFiles; + QString ServerStubFile; + qlonglong LocaleID; + VCConfiguration* config; }; @@ -700,6 +755,8 @@ public: QStringList Outputs; QString ToolName; QString ToolPath; + + VCConfiguration* config; }; class VCResourceCompilerTool : public VCToolBase @@ -720,6 +777,7 @@ public: QString ResourceOutputFileName; linkProgressOption ShowProgress; QString ToolPath; + triState SuppressStartupBanner; }; class VCDeploymentTool @@ -740,15 +798,16 @@ class VCEventTool : public VCToolBase { protected: // Functions - VCEventTool() : ExcludedFromBuild(unset){}; + VCEventTool(const QString &eventName); virtual ~VCEventTool(){} - bool parseOption(const char*){ return false; }; + bool parseOption(const char*){ return false; } public: // Variables QString CommandLine; QString Description; triState ExcludedFromBuild; + QString EventName; QString ToolName; QString ToolPath; }; @@ -791,7 +850,8 @@ public: QString DeleteExtensionsOnClean; QString ImportLibrary; QString IntermediateDirectory; - QString Name; + QString Name; // "ConfigurationName|PlatformName" + QString ConfigurationName; QString OutputDirectory; QString PrimaryOutput; QString ProgramDatabase; diff --git a/qmake/generators/win32/msvc_vcxproj.cpp b/qmake/generators/win32/msvc_vcxproj.cpp index b95e9cf..f282deb 100644 --- a/qmake/generators/win32/msvc_vcxproj.cpp +++ b/qmake/generators/win32/msvc_vcxproj.cpp @@ -63,7 +63,6 @@ QT_BEGIN_NAMESPACE VcxprojGenerator::VcxprojGenerator() : VcprojGenerator() { - projectWriter = new VCXProjectWriter; } VCProjectWriter *VcxprojGenerator::createProjectWriter() @@ -120,7 +119,7 @@ void VcxprojGenerator::initProject() vcxProject.Keyword = project->first("VCPROJ_KEYWORD"); vcxProject.PlatformName = vcxProject.Configuration.idl.TargetEnvironment; - if (vcxProject.Configuration.idl.TargetEnvironment.isEmpty()) + if (vcxProject.Configuration.idl.TargetEnvironment == midlTargetNotSet) vcxProject.PlatformName = "Win32"; // These are not used by Qt, but may be used by customers vcxProject.SccProjectName = project->first("SCCPROJECTNAME"); @@ -134,7 +133,7 @@ void VcxprojGenerator::initConfiguration() // Initialize XML sub elements // - Do this first since main configuration elements may need // - to know of certain compiler/linker options - VCXConfiguration &conf = vcxProject.Configuration; + VCConfiguration &conf = vcxProject.Configuration; initCompilerTool(); @@ -154,14 +153,14 @@ void VcxprojGenerator::initConfiguration() QString temp = project->first("BuildBrowserInformation"); switch (projectTarget) { case SharedLib: - conf.ConfigurationType = "DynamicLibrary"; + conf.ConfigurationType = typeDynamicLibrary; break; case StaticLib: - conf.ConfigurationType = "StaticLibrary"; + conf.ConfigurationType = typeStaticLibrary; break; case Application: default: - conf.ConfigurationType = "Application"; + conf.ConfigurationType = typeApplication; break; } @@ -174,35 +173,19 @@ void VcxprojGenerator::initConfiguration() conf.OutputDirectory += '\\'; // The target name could have been changed. - conf.TargetName = project->first("TARGET"); - if ( !conf.TargetName.isEmpty() && !project->first("TARGET_VERSION_EXT").isEmpty() && project->isActiveConfig("shared")) - conf.TargetName.append(project->first("TARGET_VERSION_EXT")); + conf.PrimaryOutput = project->first("TARGET"); + if ( !conf.PrimaryOutput.isEmpty() && !project->first("TARGET_VERSION_EXT").isEmpty() && project->isActiveConfig("shared")) + conf.PrimaryOutput.append(project->first("TARGET_VERSION_EXT")); conf.Name = project->values("BUILD_NAME").join(" "); if (conf.Name.isEmpty()) conf.Name = isDebug ? "Debug" : "Release"; conf.ConfigurationName = conf.Name; - conf.Name += (conf.idl.TargetEnvironment == "Win64" ? "|Win64" : "|Win32"); + conf.Name += (conf.idl.TargetEnvironment == midlTargetWin64 ? "|Win64" : "|Win32"); conf.ATLMinimizesCRunTimeLibraryUsage = (project->first("ATLMinimizesCRunTimeLibraryUsage").isEmpty() ? _False : _True); conf.BuildBrowserInformation = triState(temp.isEmpty() ? (short)unset : temp.toShort()); temp = project->first("CharacterSet"); - if (!temp.isEmpty()) - { - switch (charSet(temp.toShort())) { - - case charSetMBCS: - conf.CharacterSet = "MultiByte"; - break; - case charSetUnicode: - conf.CharacterSet = "Unicode"; - break; - case charSetNotSet: - default: - conf.CharacterSet = "NotSet"; - break; - } - conf.CharacterSet = charSet(temp.isEmpty() ? (short)charSetNotSet : temp.toShort()); - } + conf.CharacterSet = charSet(temp.isEmpty() ? (short)charSetNotSet : temp.toShort()); conf.DeleteExtensionsOnClean = project->first("DeleteExtensionsOnClean"); conf.ImportLibrary = conf.linker.ImportLibrary; conf.IntermediateDirectory = project->first("OBJECTS_DIR"); @@ -211,38 +194,10 @@ void VcxprojGenerator::initConfiguration() conf.WholeProgramOptimization = conf.compiler.WholeProgramOptimization; temp = project->first("UseOfATL"); if(!temp.isEmpty()) - { - switch (useOfATL(temp.toShort())) { - - case useATLStatic: - conf.UseOfATL = "Static"; - break; - case useATLDynamic: - conf.UseOfATL = "Dynamic"; - break; - case useATLNotSet: - default: - conf.UseOfATL = "false"; - break; - } - } + conf.UseOfATL = useOfATL(temp.toShort()); temp = project->first("UseOfMfc"); if(!temp.isEmpty()) - { - switch (useOfMfc(temp.toShort())) { - - case useMfcStatic: - conf.UseOfMfc = "Static"; - break; - case useMfcDynamic: - conf.UseOfMfc = "Dynamic"; - break; - case useMfcStdWin: - default: - conf.UseOfMfc = "false"; - break; - } - } + conf.UseOfMfc = useOfMfc(temp.toShort()); // Configuration does not need parameters from // these sub XML items; @@ -265,18 +220,18 @@ void VcxprojGenerator::initCompilerTool() if(placement.isEmpty()) placement = ".\\"; - VCXConfiguration &conf = vcxProject.Configuration; + VCConfiguration &conf = vcxProject.Configuration; conf.compiler.AssemblerListingLocation = placement ; conf.compiler.ProgramDataBaseFileName = ".\\" ; - conf.compiler.ObjectFileName = placement ; - conf.compiler.ExceptionHandling = "false"; + conf.compiler.ObjectFile = placement ; + conf.compiler.ExceptionHandling = ehNone; // PCH if (usePCH) { - conf.compiler.PrecompiledHeader = "Use"; - conf.compiler.PrecompiledHeaderOutputFile = "$(IntDir)\\" + precompPch; - conf.compiler.PrecompiledHeaderFile = project->first("PRECOMPILED_HEADER"); + conf.compiler.UsePrecompiledHeader = pchUseUsingSpecific; + conf.compiler.PrecompiledHeaderFile = "$(IntDir)\\" + precompPch; + conf.compiler.PrecompiledHeaderThrough = project->first("PRECOMPILED_HEADER"); conf.compiler.ForcedIncludeFiles = project->values("PRECOMPILED_HEADER"); - conf.compiler.PreprocessToFile = _False; + conf.compiler.GeneratePreprocessedFile = preprocessNo; conf.compiler.PreprocessSuppressLineNumbers = _False; } @@ -295,7 +250,7 @@ void VcxprojGenerator::initCompilerTool() void VcxprojGenerator::initLinkerTool() { findLibraries(); // Need to add the highest version of the libs - VCXConfiguration &conf = vcxProject.Configuration; + VCConfiguration &conf = vcxProject.Configuration; conf.linker.parseOptions(project->values("MSVCPROJ_LFLAGS")); foreach(QString libs, project->values("MSVCPROJ_LIBS")) { @@ -334,7 +289,7 @@ void VcxprojGenerator::initLinkerTool() void VcxprojGenerator::initResourceTool() { - VCXConfiguration &conf = vcxProject.Configuration; + VCConfiguration &conf = vcxProject.Configuration; conf.resource.PreprocessorDefinitions = conf.compiler.PreprocessorDefinitions; // We need to add _DEBUG for the debug version of the project, since the normal compiler defines @@ -349,12 +304,12 @@ void VcxprojGenerator::initResourceTool() void VcxprojGenerator::initPostBuildEventTools() { - VCXConfiguration &conf = vcxProject.Configuration; + VCConfiguration &conf = vcxProject.Configuration; if(!project->values("QMAKE_POST_LINK").isEmpty()) { QString cmdline = var("QMAKE_POST_LINK"); conf.postBuild.CommandLine = cmdline; conf.postBuild.Description = cmdline; - conf.postBuild.UseInBuild = _True; + conf.postBuild.ExcludedFromBuild = _False; } if(!project->values("MSVCPROJ_COPY_DLL").isEmpty()) { @@ -362,18 +317,18 @@ void VcxprojGenerator::initPostBuildEventTools() conf.postBuild.CommandLine += " && "; conf.postBuild.Description += var("MSVCPROJ_COPY_DLL_DESC"); conf.postBuild.CommandLine += var("MSVCPROJ_COPY_DLL"); - conf.postBuild.UseInBuild = _True; + conf.postBuild.ExcludedFromBuild = _False; } } void VcxprojGenerator::initPreLinkEventTools() { - VCXConfiguration &conf = vcxProject.Configuration; + VCConfiguration &conf = vcxProject.Configuration; if(!project->values("QMAKE_PRE_LINK").isEmpty()) { QString cmdline = var("QMAKE_PRE_LINK"); conf.preLink.Description = cmdline; conf.preLink.CommandLine = cmdline; - conf.preLink.UseInBuild = _True; + conf.preLink.ExcludedFromBuild = _False; } } @@ -548,7 +503,7 @@ void VcxprojGenerator::initExtraCompilerOutputs() extracompilerName = (*it); // Create an extra compiler filter and add the files - VCXFilter extraCompile; + VCFilter extraCompile; extraCompile.Name = extracompilerName; extraCompile.ParseFiles = _False; extraCompile.Filter = ""; @@ -626,9 +581,9 @@ bool VcxprojGenerator::writeProjectMakefile() } debug_msg(1, "Generator: MSVC.NET: Writing project file"); - VCXProject mergedProject; + VCProject mergedProject; for (int i = 0; i < mergedProjects.count(); ++i) { - VCXProjectSingleConfig *singleProject = &(mergedProjects.at(i)->vcxProject); + VCProjectSingleConfig *singleProject = &(mergedProjects.at(i)->vcxProject); mergedProject.SingleProjects += *singleProject; for (int j = 0; j < singleProject->ExtraCompilersFiles.count(); ++j) { const QString &compilerName = singleProject->ExtraCompilersFiles.at(j).Name; diff --git a/qmake/generators/win32/msvc_vcxproj.h b/qmake/generators/win32/msvc_vcxproj.h index bc79c0b..16e02b1 100644 --- a/qmake/generators/win32/msvc_vcxproj.h +++ b/qmake/generators/win32/msvc_vcxproj.h @@ -56,7 +56,6 @@ class VcxprojGenerator : public VcprojGenerator public: VcxprojGenerator(); ~VcxprojGenerator(); - VCXProjectWriter *projectWriter; // ### remove, once we've killed the VCX classes protected: virtual VCProjectWriter *createProjectWriter(); @@ -83,13 +82,13 @@ protected: void initExtraCompilerOutputs(); // Used for single project - VCXProjectSingleConfig vcxProject; + VCProjectSingleConfig vcxProject; // Holds all configurations for glue (merged) project QList<VcxprojGenerator*> mergedProjects; private: - friend class VCXFilter; + friend class VCFilter; }; |