author | llornkcor <llornkcor> | 2003-07-10 02:40:10 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-07-10 02:40:10 (UTC) |
commit | 155d68c1e7d7dc0fed2534ac43d6d77ce2781f55 (patch) (side-by-side diff) | |
tree | e6edaa5a7040fe6c224c3943d1094dcf02e4f74c /qmake/generators/win32/msvc_objectmodel.cpp | |
parent | 86703e8a5527ef114facd02c005b6b3a7e62e263 (diff) | |
download | opie-155d68c1e7d7dc0fed2534ac43d6d77ce2781f55.zip opie-155d68c1e7d7dc0fed2534ac43d6d77ce2781f55.tar.gz opie-155d68c1e7d7dc0fed2534ac43d6d77ce2781f55.tar.bz2 |
update qmake to 1.05a
Diffstat (limited to 'qmake/generators/win32/msvc_objectmodel.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | qmake/generators/win32/msvc_objectmodel.cpp | 243 |
1 files changed, 140 insertions, 103 deletions
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index c2b9e30..7ffe4f7 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -253,29 +253,29 @@ const char* _WholeProgramOptimization = "\n\t\t\t\tWholeProgramOptimization=\"" // Property name and value as Pairs --------------------------------- struct TPair { TPair( const char* n, const triState v ) : name(n), value(v) {}; - const char* name; - const triState value; + const char* name; + const triState value; }; -struct EPair { +struct EPair { EPair( const char* n, const int v ) : name(n), value(v) {}; - const char* name; + const char* name; const int value; }; -struct LPair { +struct LPair { LPair( const char* n, const long v ) : name(n), value(v) {}; - const char* name; - const long value; + const char* name; + const long value; }; -struct SPair { +struct SPair { SPair( const char* n, const QString& v ) : name(n), value(v) {}; - const char* name; - const QString& value; + const char* name; + const QString& value; }; -struct XPair { +struct XPair { XPair( const char* n, const QStringList& v, const char* s = "," ) : name(n), value(v), sep(s) {}; - const char* name; + const char* name; const QStringList& value; const char* sep; }; @@ -382,9 +382,9 @@ QTextStream &operator<<( QTextStream &strm, const VCCLCompilerTool &tool ) { strm << _begTool3; strm << _VCCLCompilerToolName; strm << XPair( _AdditionalIncludeDirectories, tool.AdditionalIncludeDirectories ); - strm << XPair( _AdditionalOptions, tool.AdditionalOptions ); + strm << XPair( _AdditionalOptions, tool.AdditionalOptions, " " ); strm << XPair( _AdditionalUsingDirectories, tool.AdditionalUsingDirectories ); strm << SPair( _AssemblerListingLocation, tool.AssemblerListingLocation ); if ( tool.AssemblerOutput != asmListingNone ) strm << EPair( _AssemblerOutput, tool.AssemblerOutput ); if ( tool.BasicRuntimeChecks != runtimeBasicCheckNone ) strm << EPair( _BasicRuntimeChecks, tool.BasicRuntimeChecks ); @@ -441,36 +441,40 @@ QTextStream &operator<<( QTextStream &strm, const VCCLCompilerTool &tool ) !tool.PrecompiledHeaderThrough.isEmpty() ) strm << EPair( _UsePrecompiledHeader, tool.UsePrecompiledHeader ); strm << TPair( _WarnAsError, tool.WarnAsError ); strm << EPair( _WarningLevel, tool.WarningLevel ); - strm << TPair( _WholeProgramOptimization, tool.WholeProgramOptimization ); + strm << TPair( _WholeProgramOptimization, tool.WholeProgramOptimization ); strm << "/>"; return strm; } bool VCCLCompilerTool::parseOption( const char* option ) { // skip index 0 ('/' or '-') - char first = option[1]; + char first = option[1]; char second = option[2]; char third = option[3]; char fourth = option[4]; + bool found = TRUE; switch ( first ) { case '?': case 'h': qWarning( "Generator: Option '/?', '/help': MSVC.NET projects do not support outputting help info" ); - return FALSE; + found = FALSE; + break; case '@': qWarning( "Generator: Option '/@': MSVC.NET projects do not support the use of a response file" ); - return FALSE; + found = FALSE; + break; case 'l': qWarning( "Generator: Option '/link': qmake generator does not support passing link options through the compiler tool" ); - return FALSE; - + found = FALSE; + break; case 'A': - if ( second != 'I' ) - return FALSE; + if ( second != 'I' ) { + found = FALSE; break; + } AdditionalUsingDirectories += option+2; break; case 'C': KeepComments = _True; @@ -486,9 +490,9 @@ bool VCCLCompilerTool::parseOption( const char* option ) ExceptionHandling = _False; AdditionalOptions += option; break; } - return FALSE; + found = FALSE; break; } GeneratePreprocessedFile = preprocessYes; break; case 'F': @@ -543,18 +547,18 @@ bool VCCLCompilerTool::parseOption( const char* option ) case 'x': ExpandAttributedSource = _True; break; default: - return FALSE; + found = FALSE; break; } } break; case 'G': switch ( second ) { case '3': case '4': qWarning( "Option '/G3' and '/G4' were phased out in Visual C++ 5.0" ); - return FALSE; + found = FALSE; break; case '5': OptimizeForProcessor = procOptimizePentium; break; case '6': @@ -618,9 +622,9 @@ bool VCCLCompilerTool::parseOption( const char* option ) case 'z': CallingConvention = callConventionStdCall; break; default: - return FALSE; + found = FALSE; break; } break; case 'H': AdditionalOptions += option; @@ -632,9 +636,9 @@ bool VCCLCompilerTool::parseOption( const char* option ) if ( second == 'D' ) { AdditionalOptions += option; break; } - return FALSE; + found = FALSE; break; case 'M': if ( second == 'D' ) { RuntimeLibrary = rtMultiThreadedDLL; if ( third == 'd' ) @@ -650,9 +654,9 @@ bool VCCLCompilerTool::parseOption( const char* option ) if ( third == 'd' ) RuntimeLibrary = rtMultiThreadedDebug; break; } - return FALSE; + found = FALSE; break; case 'O': switch ( second ) { case '1': Optimization = optimizeMinSpace; @@ -670,9 +674,9 @@ bool VCCLCompilerTool::parseOption( const char* option ) InlineFunctionExpansion = expandOnlyInline; else if ( third == '2' ) InlineFunctionExpansion = expandAnySuitable; else - return FALSE; + found = FALSE; break; case 'd': Optimization = optimizeDisabled; break; @@ -704,9 +708,9 @@ bool VCCLCompilerTool::parseOption( const char* option ) if ( third == '-' ) OmitFramePointers = _False; break; default: - return FALSE; + found = FALSE; break; } break; case 'P': GeneratePreprocessedFile = preprocessYes; @@ -715,9 +719,9 @@ bool VCCLCompilerTool::parseOption( const char* option ) if ( second == 'I' ) { AdditionalOptions += option; break; } - return FALSE; + found = FALSE; break; case 'R': if ( second == 'T' && third == 'C' ) { if ( fourth == '1' ) BasicRuntimeChecks = runtimeBasicCheckAll; @@ -727,9 +731,9 @@ bool VCCLCompilerTool::parseOption( const char* option ) BasicRuntimeChecks = runtimeCheckStackFrame; else if ( fourth == 'u' ) BasicRuntimeChecks = runtimeCheckUninitVariables; else - return FALSE; + found = FALSE; break; } break; case 'T': if ( second == 'C' ) { @@ -737,9 +741,9 @@ bool VCCLCompilerTool::parseOption( const char* option ) } else if ( second == 'P' ) { CompileAs = compileAsCPlusPlus; } else { qWarning( "Generator: Options '/Tp<filename>' and '/Tc<filename>' are not supported by qmake" ); - return FALSE; + found = FALSE; break; } break; case 'U': UndefinePreprocessorDefinitions += option+2; @@ -777,9 +781,9 @@ bool VCCLCompilerTool::parseOption( const char* option ) break; } // Fallthrough default: - return FALSE; + found = FALSE; break; } break; case 'X': IgnoreStandardIncludePath = _True; @@ -806,9 +810,9 @@ bool VCCLCompilerTool::parseOption( const char* option ) UsePrecompiledHeader = pchUseUsingSpecific; PrecompiledHeaderFile = option+3; break; default: - return FALSE; + found = FALSE; break; } break; case 'Z': switch ( second ) { @@ -839,11 +843,11 @@ bool VCCLCompilerTool::parseOption( const char* option ) ForceConformanceInForLoopScope = _True; else if ( fourth == 'w' ) TreatWChar_tAsBuiltInType = _True; else - return FALSE; + found = FALSE; } else { - return FALSE; + found = FALSE; break; } break; case 'g': case 'm': @@ -868,13 +872,13 @@ bool VCCLCompilerTool::parseOption( const char* option ) case '8': StructMemberAlignment = alignEightBytes; break; default: - return FALSE; + found = FALSE; break; } break; default: - return FALSE; + found = FALSE; break; } break; case 'c': if ( second == '\0' ) { @@ -886,14 +890,15 @@ bool VCCLCompilerTool::parseOption( const char* option ) } else { CompileAsManaged = managedAssembly; } } else { - return FALSE; + found = FALSE; break; } break; case 'd': - if ( second != 'r' ) - return FALSE; + if ( second != 'r' ) { + found = FALSE; break; + } CompileAsManaged = managedAssembly; break; case 'n': if ( second == 'o' && third == 'B' && fourth == 'o' ) { @@ -903,24 +908,24 @@ bool VCCLCompilerTool::parseOption( const char* option ) if ( second == 'o' && third == 'l' && fourth == 'o' ) { SuppressStartupBanner = _True; break; } - return FALSE; + found = FALSE; break; case 's': if ( second == 'h' && third == 'o' && fourth == 'w' ) { ShowIncludes = _True; break; } - return FALSE; + found = FALSE; break; case 'u': UndefineAllPreprocessorDefinitions = _True; break; case 'v': if ( second == 'd' || second == 'm' ) { AdditionalOptions += option; break; } - return FALSE; + found = FALSE; break; case 'w': switch ( second ) { case '\0': WarningLevel = warningLevel_0; @@ -932,10 +937,12 @@ bool VCCLCompilerTool::parseOption( const char* option ) AdditionalOptions += option; } break; default: - return FALSE; + found = FALSE; break; } + if( !found ) + warn_msg( WarnLogic, "Could not parse Compiler option: %s", option ); return TRUE; } // VCLinkerTool ----------------------------------------------------- @@ -979,9 +986,9 @@ QTextStream &operator<<( QTextStream &strm, const VCLinkerTool &tool ) strm << _begTool3; strm << _VCLinkerToolName; strm << XPair( _AdditionalDependencies4, tool.AdditionalDependencies, " " ); strm << XPair( _AdditionalLibraryDirectories, tool.AdditionalLibraryDirectories ); - strm << XPair( _AdditionalOptions, tool.AdditionalOptions ); + strm << XPair( _AdditionalOptions, tool.AdditionalOptions, " " ); strm << XPair( _AddModuleNamesToAssembly, tool.AddModuleNamesToAssembly ); strm << SPair( _BaseAddress, tool.BaseAddress ); strm << XPair( _DelayLoadDLLs, tool.DelayLoadDLLs ); if ( tool.EnableCOMDATFolding != optFoldingDefault ) strm << EPair( _EnableCOMDATFolding, tool.EnableCOMDATFolding ); @@ -1045,10 +1052,10 @@ static uint elfHash( const char* name ) uint g; if ( name ) { k = (const uchar *) name; - while ( (*k) && - (*k)!= ':' && + while ( (*k) && + (*k)!= ':' && (*k)!=',' && (*k)!=' ' ) { h = ( h << 4 ) + *k++; if ( (g = (h & 0xf0000000)) != 0 ) @@ -1059,47 +1066,51 @@ static uint elfHash( const char* name ) 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 VCLinkerTool::parseOption( const char* option ) { -#if 0 +#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( "/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( "/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( "/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 " ); #endif -#if 0 +#ifdef USE_DISPLAY_HASH // Sub options displayHash( "UNLOAD" ); displayHash( "NOBIND" ); displayHash( "no" ); displayHash( "NOSTATUS" ); displayHash( "STATUS" ); - displayHash( "AM33" ); displayHash( "ARM" ); displayHash( "CEE" ); displayHash( "IA64" ); displayHash( "X86" ); displayHash( "M32R" ); - displayHash( "MIPS" ); displayHash( "MIPS16" ); displayHash( "MIPSFPU" ); displayHash( "MIPSFPU16" ); displayHash( "MIPSR41XX" ); displayHash( "PPC" ); - displayHash( "SH3" ); 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" ); + displayHash( "AM33" ); displayHash( "ARM" ); displayHash( "CEE" ); displayHash( "IA64" ); displayHash( "X86" ); displayHash( "M32R" ); + displayHash( "MIPS" ); displayHash( "MIPS16" ); displayHash( "MIPSFPU" ); displayHash( "MIPSFPU16" ); displayHash( "MIPSR41XX" ); displayHash( "PPC" ); + displayHash( "SH3" ); 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 0x3360dbe: // /ALIGN[:number] case 0x1485c34: // /ALLOWBIND[:NO] case 0x6b21972: // /DEFAULTLIB:library @@ -1140,9 +1151,9 @@ bool VCLinkerTool::parseOption( const char* option ) case 0x06f4bf4: // /DELAYLOAD:dllname DelayLoadDLLs += option+11; break; // case 0x003390c: // /DLL - // This option is not used for vcproj files + // This option is not used for vcproj files // break; case 0x33a3979: // /ENTRY:function EntryPointSymbol = option+7; break; @@ -1191,9 +1202,9 @@ bool VCLinkerTool::parseOption( const char* option ) ShowProgress = linkProgressAll; break; case 0x157cf65: // /MACHINE:{AM33|ARM|CEE|IA64|X86|M32R|MIPS|MIPS16|MIPSFPU|MIPSFPU16|MIPSR41XX|PPC|SH3|SH4|SH5|THUMB|TRICORE} switch ( elfHash(option+9) ) { - // Very limited documentation on all options but X86, + // Very limited documentation on all options but X86, // so we put the others in AdditionalOptions... case 0x0046063: // AM33 case 0x000466d: // ARM case 0x0004795: // CEE @@ -1215,9 +1226,9 @@ bool VCLinkerTool::parseOption( const char* option ) case 0x0005bb6: // X86 TargetMachine = machineX86; break; default: - return FALSE; + found = FALSE; } break; case 0x0034160: // /MAP[:filename] GenerateMapFile = _True; @@ -1274,9 +1285,9 @@ bool VCLinkerTool::parseOption( const char* option ) case 'W': // NOWIN98 OptimizeForWindows98 = optWin98No; break; default: - return FALSE; + found = FALSE; } } break; case 0x34468a2: // /ORDER:@filename @@ -1323,9 +1334,9 @@ bool VCLinkerTool::parseOption( const char* option ) case 0x2949c95: // WINDOWSCE AdditionalOptions += option; break; default: - return FALSE; + found = FALSE; } } break; case 0x8b654de: // /SWAPRUN:{NET | CD} @@ -1333,9 +1344,9 @@ bool VCLinkerTool::parseOption( const char* option ) SwapRunFromNet = _True; else if ( *(option+9) == 'C' ) SwapRunFromCD = _True; else - return FALSE; + found = FALSE; break; case 0x34906d4: // /TLBID:id TypeLibraryResourceID = QString( option+7 ).toLong(); break; @@ -1359,11 +1370,13 @@ bool VCLinkerTool::parseOption( const char* option ) case 0xaa77f7e: // /VERSION:major[.minor] Version = option+9; break; default: - return FALSE; + found = FALSE; } - return TRUE; + if( !found ) + warn_msg( WarnLogic, "Could not parse Linker options: %s", option ); + return found; } // VCMIDLTool ------------------------------------------------------- VCMIDLTool::VCMIDLTool() @@ -1391,9 +1404,9 @@ QTextStream &operator<<( QTextStream &strm, const VCMIDLTool &tool ) { strm << _begTool3; strm << _VCMIDLToolName; strm << XPair( _AdditionalIncludeDirectories, tool.AdditionalIncludeDirectories ); - strm << XPair( _AdditionalOptions, tool.AdditionalOptions ); + strm << XPair( _AdditionalOptions, tool.AdditionalOptions, " " ); strm << XPair( _CPreprocessOptions, tool.CPreprocessOptions ); strm << EPair( _DefaultCharType, tool.DefaultCharType ); strm << SPair( _DLLDataFileName, tool.DLLDataFileName ); strm << EPair( _EnableErrorChecks, tool.EnableErrorChecks ); @@ -1426,17 +1439,17 @@ QTextStream &operator<<( QTextStream &strm, const VCMIDLTool &tool ) } bool VCMIDLTool::parseOption( const char* option ) { -#if 0 +#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( "/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" ); @@ -1444,9 +1457,9 @@ bool VCMIDLTool::parseOption( const char* option ) 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( "/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" ); @@ -1454,8 +1467,9 @@ bool VCMIDLTool::parseOption( const char* option ) 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; @@ -1489,9 +1503,9 @@ bool VCMIDLTool::parseOption( const char* option ) case '8': StructMemberAlignment = midlAlignEightBytes; break; default: - return FALSE; + found = FALSE; } break; case 0x0359e82: // /char {ascii7|signed|unsigned} switch( *(option+6) ) { @@ -1504,9 +1518,9 @@ bool VCMIDLTool::parseOption( const char* option ) case 'u': DefaultCharType = midlCharUnsigned; break; default: - return FALSE; + found = FALSE; } break; case 0xa766524: // /cpp_opt options CPreprocessOptions += option+9; @@ -1535,15 +1549,15 @@ bool VCMIDLTool::parseOption( const char* option ) case 'n': EnableErrorChecks = midlDisableAll; break; case 'r': - break; ErrorCheckRefPointers = _True; - case 's': break; + case 's': ErrorCheckStubData = _True; + break; default: - return FALSE; + found = FALSE; } break; case 0x5eb7af2: // /header filename offset = 5; @@ -1646,13 +1660,15 @@ bool VCMIDLTool::parseOption( const char* option ) case '4': WarningLevel = midlWarningLevel_4; break; default: - return FALSE; + found = FALSE; } } break; } + if( !found ) + warn_msg( WarnLogic, "Could not parse MIDL option: %s", option ); return TRUE; } // VCLibrarianTool -------------------------------------------------- @@ -1667,9 +1683,9 @@ QTextStream &operator<<( QTextStream &strm, const VCLibrarianTool &tool ) strm << _begTool3; strm << SPair( _ToolName, QString( "VCLibrarianTool" ) ); strm << XPair( _AdditionalDependencies4, tool.AdditionalDependencies ); strm << XPair( _AdditionalLibraryDirectories, tool.AdditionalLibraryDirectories ); - strm << XPair( _AdditionalOptions, tool.AdditionalOptions ); + strm << XPair( _AdditionalOptions, tool.AdditionalOptions, " " ); strm << XPair( _ExportNamedFunctions, tool.ExportNamedFunctions ); strm << XPair( _ForceSymbolReferences, tool.ForceSymbolReferences ); strm << TPair( _IgnoreAllDefaultLibraries, tool.IgnoreAllDefaultLibraries ); strm << XPair( _IgnoreDefaultLibraryNames, tool.IgnoreDefaultLibraryNames ); @@ -1713,9 +1729,9 @@ QTextStream &operator<<( QTextStream &strm, const VCResourceCompilerTool &tool ) strm << _begTool3; strm << _VCResourceCompilerToolName; strm << SPair( _ToolPath, tool.ToolPath ); strm << XPair( _AdditionalIncludeDirectories, tool.AdditionalIncludeDirectories ); - strm << XPair( _AdditionalOptions, tool.AdditionalOptions ); + strm << XPair( _AdditionalOptions, tool.AdditionalOptions, " " ); if ( tool.Culture != rcUseDefault ) strm << EPair( _Culture, tool.Culture ); strm << XPair( _FullIncludePath, tool.FullIncludePath ); strm << TPair( _IgnoreStandardIncludePath, tool.IgnoreStandardIncludePath ); strm << XPair( _PreprocessorDefinitions, tool.PreprocessorDefinitions ); @@ -1850,15 +1866,36 @@ void VCFilter::generateUIC( QTextStream &strm, const QString& str ) const QString uicApp = Project->var("QMAKE_UIC"); QString mocApp = Project->var( "QMAKE_MOC" ); QString fname = str.section( '\\', -1 ); QString mocDir = Project->var( "MOC_DIR" ); + QString uiDir = Project->var( "UI_DIR" ); + QString uiHeaders; + QString uiSources; + + // Determining the paths for the output files. + int slash = str.findRev( '\\' ); + QString pname = ( slash != -1 ) ? str.left( slash+1 ) : QString( ".\\" ); + if( !uiDir.isEmpty() ) { + uiHeaders = uiDir; + uiSources = uiDir; + } else { + uiHeaders = Project->var( "UI_HEADERS_DIR" ); + uiSources = Project->var( "UI_SOURCES_DIR" ); + if( uiHeaders.isEmpty() ) + uiHeaders = pname; + if( uiSources.isEmpty() ) + uiSources = pname; + } + if( !uiHeaders.endsWith( "\\" ) ) + uiHeaders += "\\"; + if( !uiSources.endsWith( "\\" ) ) + uiSources += "\\"; + + // Determine the file name. int dot = fname.findRev( '.' ); - if( dot != -1 ) + if( dot != -1 ) fname.truncate( dot ); - int slash = str.findRev( '\\' ); - QString pname = ( slash != -1 ) ? str.left( slash+1 ) : QString(".\\"); - strm << _begFileConfiguration; strm << _Name5; strm << Config->Name; strm << "\">"; @@ -1866,15 +1903,15 @@ void VCFilter::generateUIC( QTextStream &strm, const QString& str ) const strm << _VCCustomBuildTool; strm << _Description6; strm << "Uic'ing " << str << "...\""; strm << _CommandLine6; - strm << uicApp << " " << str << " -o " << pname << fname << ".h && "; // Create .h from .ui file - strm << uicApp << " " << str << " -i " << fname << ".h -o " << pname << fname << ".cpp && "; // Create .cpp from .ui file - strm << mocApp << " " << pname << fname << ".h -o " << mocDir << "moc_" << fname << ".cpp\""; + strm << uicApp << " " << str << " -o " << uiHeaders << fname << ".h && "; // Create .h from .ui file + strm << uicApp << " " << str << " -i " << fname << ".h -o " << uiSources << fname << ".cpp && "; // Create .cpp from .ui file + strm << mocApp << " " << uiHeaders << fname << ".h -o " << mocDir << "moc_" << fname << ".cpp\""; strm << _AdditionalDependencies6; strm << mocApp << ";" << uicApp << "\""; strm << _Outputs6; - strm << pname << fname << ".h;" << pname << fname << ".cpp;" << mocDir << "moc_" << fname << ".cpp\""; + strm << uiHeaders << fname << ".h;" << uiSources << fname << ".cpp;" << mocDir << "moc_" << fname << ".cpp\""; strm << "/>"; strm << _endFileConfiguration; } @@ -1905,11 +1942,11 @@ QTextStream &operator<<( QTextStream &strm, const VCFilter &tool ) // VCProject -------------------------------------------------------- VCProject::VCProject() { - QUuid uniqueId; #if defined(Q_WS_WIN32) GUID guid; + QUuid uniqueId; HRESULT h = CoCreateGuid( &guid ); if ( h == S_OK ) uniqueId = QUuid( guid ); ProjectGUID = uniqueId.toString(); |