author | llornkcor <llornkcor> | 2003-07-10 02:40:10 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-07-10 02:40:10 (UTC) |
commit | 155d68c1e7d7dc0fed2534ac43d6d77ce2781f55 (patch) (unidiff) | |
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 | |||
@@ -209,117 +209,117 @@ const char* _RuntimeLibrary = "\n\t\t\t\tRuntimeLibrary=\""; | |||
209 | const char* _RuntimeTypeInfo = "\n\t\t\t\tRuntimeTypeInfo=\""; | 209 | const char* _RuntimeTypeInfo = "\n\t\t\t\tRuntimeTypeInfo=\""; |
210 | const char* _SccProjectName = "\n\tSccProjectName=\""; | 210 | const char* _SccProjectName = "\n\tSccProjectName=\""; |
211 | const char* _SccLocalPath = "\n\tSccLocalPath=\""; | 211 | const char* _SccLocalPath = "\n\tSccLocalPath=\""; |
212 | const char* _SetChecksum = "\n\t\t\t\tSetChecksum=\""; | 212 | const char* _SetChecksum = "\n\t\t\t\tSetChecksum=\""; |
213 | const char* _ShowIncludes = "\n\t\t\t\tShowIncludes=\""; | 213 | const char* _ShowIncludes = "\n\t\t\t\tShowIncludes=\""; |
214 | const char* _ShowProgress = "\n\t\t\t\tShowProgress=\""; | 214 | const char* _ShowProgress = "\n\t\t\t\tShowProgress=\""; |
215 | const char* _SmallerTypeCheck = "\n\t\t\t\tSmallerTypeCheck=\""; | 215 | const char* _SmallerTypeCheck = "\n\t\t\t\tSmallerTypeCheck=\""; |
216 | const char* _StackCommitSize = "\n\t\t\t\tStackCommitSize=\""; | 216 | const char* _StackCommitSize = "\n\t\t\t\tStackCommitSize=\""; |
217 | const char* _StackReserveSize = "\n\t\t\t\tStackReserveSize=\""; | 217 | const char* _StackReserveSize = "\n\t\t\t\tStackReserveSize=\""; |
218 | const char* _StringPooling = "\n\t\t\t\tStringPooling=\""; | 218 | const char* _StringPooling = "\n\t\t\t\tStringPooling=\""; |
219 | const char* _StripPrivateSymbols = "\n\t\t\t\tStripPrivateSymbols=\""; | 219 | const char* _StripPrivateSymbols = "\n\t\t\t\tStripPrivateSymbols=\""; |
220 | const char* _StructMemberAlignment = "\n\t\t\t\tStructMemberAlignment=\""; | 220 | const char* _StructMemberAlignment = "\n\t\t\t\tStructMemberAlignment=\""; |
221 | const char* _SubSystem = "\n\t\t\t\tSubSystem=\""; | 221 | const char* _SubSystem = "\n\t\t\t\tSubSystem=\""; |
222 | const char* _SupportUnloadOfDelayLoadedDLL = "\n\t\t\t\tSupportUnloadOfDelayLoadedDLL=\""; | 222 | const char* _SupportUnloadOfDelayLoadedDLL = "\n\t\t\t\tSupportUnloadOfDelayLoadedDLL=\""; |
223 | const char* _SuppressStartupBanner = "\n\t\t\t\tSuppressStartupBanner=\""; | 223 | const char* _SuppressStartupBanner = "\n\t\t\t\tSuppressStartupBanner=\""; |
224 | const char* _SwapRunFromCD = "\n\t\t\t\tSwapRunFromCD=\""; | 224 | const char* _SwapRunFromCD = "\n\t\t\t\tSwapRunFromCD=\""; |
225 | const char* _SwapRunFromNet = "\n\t\t\t\tSwapRunFromNet=\""; | 225 | const char* _SwapRunFromNet = "\n\t\t\t\tSwapRunFromNet=\""; |
226 | const char* _TargetEnvironment = "\n\t\t\t\tTargetEnvironment=\""; | 226 | const char* _TargetEnvironment = "\n\t\t\t\tTargetEnvironment=\""; |
227 | const char* _TargetMachine = "\n\t\t\t\tTargetMachine=\""; | 227 | const char* _TargetMachine = "\n\t\t\t\tTargetMachine=\""; |
228 | const char* _TerminalServerAware = "\n\t\t\t\tTerminalServerAware=\""; | 228 | const char* _TerminalServerAware = "\n\t\t\t\tTerminalServerAware=\""; |
229 | const char* _ToolName = "\n\t\t\t\tName=\""; | 229 | const char* _ToolName = "\n\t\t\t\tName=\""; |
230 | const char* _ToolPath = "\n\t\t\t\tPath=\""; | 230 | const char* _ToolPath = "\n\t\t\t\tPath=\""; |
231 | const char* _TreatWChar_tAsBuiltInType = "\n\t\t\t\tTreatWChar_tAsBuiltInType=\""; | 231 | const char* _TreatWChar_tAsBuiltInType = "\n\t\t\t\tTreatWChar_tAsBuiltInType=\""; |
232 | const char* _TurnOffAssemblyGeneration = "\n\t\t\t\tTurnOffAssemblyGeneration=\""; | 232 | const char* _TurnOffAssemblyGeneration = "\n\t\t\t\tTurnOffAssemblyGeneration=\""; |
233 | const char* _TypeLibraryFile = "\n\t\t\t\tTypeLibraryFile=\""; | 233 | const char* _TypeLibraryFile = "\n\t\t\t\tTypeLibraryFile=\""; |
234 | const char* _TypeLibraryName = "\n\t\t\t\tTypeLibraryName=\""; | 234 | const char* _TypeLibraryName = "\n\t\t\t\tTypeLibraryName=\""; |
235 | const char* _TypeLibraryResourceID = "\n\t\t\t\tTypeLibraryResourceID=\""; | 235 | const char* _TypeLibraryResourceID = "\n\t\t\t\tTypeLibraryResourceID=\""; |
236 | const char* _UndefineAllPreprocessorDefinitions = "\n\t\t\t\tUndefineAllPreprocessorDefinitions=\""; | 236 | const char* _UndefineAllPreprocessorDefinitions = "\n\t\t\t\tUndefineAllPreprocessorDefinitions=\""; |
237 | const char* _UndefinePreprocessorDefinitions = "\n\t\t\t\tUndefinePreprocessorDefinitions=\""; | 237 | const char* _UndefinePreprocessorDefinitions = "\n\t\t\t\tUndefinePreprocessorDefinitions=\""; |
238 | const char* _UseOfATL = "\n\t\t\tUseOfATL=\""; | 238 | const char* _UseOfATL = "\n\t\t\tUseOfATL=\""; |
239 | const char* _UseOfMfc = "\n\t\t\tUseOfMfc=\""; | 239 | const char* _UseOfMfc = "\n\t\t\tUseOfMfc=\""; |
240 | const char* _UsePrecompiledHeader = "\n\t\t\t\tUsePrecompiledHeader=\""; | 240 | const char* _UsePrecompiledHeader = "\n\t\t\t\tUsePrecompiledHeader=\""; |
241 | const char* _ValidateParameters = "\n\t\t\t\tValidateParameters=\""; | 241 | const char* _ValidateParameters = "\n\t\t\t\tValidateParameters=\""; |
242 | const char* _VCCLCompilerToolName = "\n\t\t\t\tName=\"VCCLCompilerTool\""; | 242 | const char* _VCCLCompilerToolName = "\n\t\t\t\tName=\"VCCLCompilerTool\""; |
243 | const char* _VCCustomBuildTool = "\n\t\t\t\t\t\tName=\"VCCustomBuildTool\""; | 243 | const char* _VCCustomBuildTool = "\n\t\t\t\t\t\tName=\"VCCustomBuildTool\""; |
244 | const char* _VCLinkerToolName = "\n\t\t\t\tName=\"VCLinkerTool\""; | 244 | const char* _VCLinkerToolName = "\n\t\t\t\tName=\"VCLinkerTool\""; |
245 | const char* _VCResourceCompilerToolName = "\n\t\t\t\tName=\"VCResourceCompilerTool\""; | 245 | const char* _VCResourceCompilerToolName = "\n\t\t\t\tName=\"VCResourceCompilerTool\""; |
246 | const char* _VCMIDLToolName = "\n\t\t\t\tName=\"VCMIDLTool\""; | 246 | const char* _VCMIDLToolName = "\n\t\t\t\tName=\"VCMIDLTool\""; |
247 | const char* _Version1 = "\n\tVersion=\""; | 247 | const char* _Version1 = "\n\tVersion=\""; |
248 | const char* _Version4 = "\n\t\t\t\tVersion=\""; | 248 | const char* _Version4 = "\n\t\t\t\tVersion=\""; |
249 | const char* _WarnAsError = "\n\t\t\t\tWarnAsError=\""; | 249 | const char* _WarnAsError = "\n\t\t\t\tWarnAsError=\""; |
250 | const char* _WarnLevel = "\n\t\t\t\tWarnLevel=\""; | 250 | const char* _WarnLevel = "\n\t\t\t\tWarnLevel=\""; |
251 | const char* _WarningLevel = "\n\t\t\t\tWarningLevel=\""; | 251 | const char* _WarningLevel = "\n\t\t\t\tWarningLevel=\""; |
252 | const char* _WholeProgramOptimization = "\n\t\t\t\tWholeProgramOptimization=\""; | 252 | const char* _WholeProgramOptimization = "\n\t\t\t\tWholeProgramOptimization=\""; |
253 | 253 | ||
254 | // Property name and value as Pairs --------------------------------- | 254 | // Property name and value as Pairs --------------------------------- |
255 | struct TPair { | 255 | struct TPair { |
256 | TPair( const char* n, const triState v ) : name(n), value(v) {}; | 256 | TPair( const char* n, const triState v ) : name(n), value(v) {}; |
257 | const char* name; | 257 | const char* name; |
258 | const triState value; | 258 | const triState value; |
259 | }; | 259 | }; |
260 | struct EPair { | 260 | struct EPair { |
261 | EPair( const char* n, const int v ) : name(n), value(v) {}; | 261 | EPair( const char* n, const int v ) : name(n), value(v) {}; |
262 | const char* name; | 262 | const char* name; |
263 | const int value; | 263 | const int value; |
264 | }; | 264 | }; |
265 | struct LPair { | 265 | struct LPair { |
266 | LPair( const char* n, const long v ) : name(n), value(v) {}; | 266 | LPair( const char* n, const long v ) : name(n), value(v) {}; |
267 | const char* name; | 267 | const char* name; |
268 | const long value; | 268 | const long value; |
269 | }; | 269 | }; |
270 | struct SPair { | 270 | struct SPair { |
271 | SPair( const char* n, const QString& v ) : name(n), value(v) {}; | 271 | SPair( const char* n, const QString& v ) : name(n), value(v) {}; |
272 | const char* name; | 272 | const char* name; |
273 | const QString& value; | 273 | const QString& value; |
274 | }; | 274 | }; |
275 | struct XPair { | 275 | struct XPair { |
276 | XPair( const char* n, const QStringList& v, const char* s = "," ) : name(n), value(v), sep(s) {}; | 276 | XPair( const char* n, const QStringList& v, const char* s = "," ) : name(n), value(v), sep(s) {}; |
277 | const char* name; | 277 | const char* name; |
278 | const QStringList& value; | 278 | const QStringList& value; |
279 | const char* sep; | 279 | const char* sep; |
280 | }; | 280 | }; |
281 | 281 | ||
282 | // void streamSPair( QTextStream &strm, const char *n, const QString &s ) | 282 | // void streamSPair( QTextStream &strm, const char *n, const QString &s ) |
283 | 283 | ||
284 | 284 | ||
285 | // Streaming operators for property Pairs --------------------------- | 285 | // Streaming operators for property Pairs --------------------------- |
286 | QTextStream &operator<<( QTextStream &strm, const TPair &prop ) | 286 | QTextStream &operator<<( QTextStream &strm, const TPair &prop ) |
287 | { | 287 | { |
288 | switch( prop.value ) { | 288 | switch( prop.value ) { |
289 | case _False: | 289 | case _False: |
290 | strm << prop.name << "FALSE\""; | 290 | strm << prop.name << "FALSE\""; |
291 | break; | 291 | break; |
292 | case _True: | 292 | case _True: |
293 | strm << prop.name << "TRUE\""; | 293 | strm << prop.name << "TRUE\""; |
294 | break; | 294 | break; |
295 | case unset: | 295 | case unset: |
296 | default: | 296 | default: |
297 | break; | 297 | break; |
298 | } | 298 | } |
299 | return strm; | 299 | return strm; |
300 | } | 300 | } |
301 | 301 | ||
302 | /* Be sure to check that each enum is not set to | 302 | /* Be sure to check that each enum is not set to |
303 | default before streaming it out. Defaults seem | 303 | default before streaming it out. Defaults seem |
304 | to not be in the XML file. | 304 | to not be in the XML file. |
305 | */ | 305 | */ |
306 | QTextStream &operator<<( QTextStream &strm, const EPair &prop ) | 306 | QTextStream &operator<<( QTextStream &strm, const EPair &prop ) |
307 | { | 307 | { |
308 | strm << prop.name << prop.value << "\""; | 308 | strm << prop.name << prop.value << "\""; |
309 | return strm; | 309 | return strm; |
310 | } | 310 | } |
311 | 311 | ||
312 | QTextStream &operator<<( QTextStream &strm, const LPair &prop ) | 312 | QTextStream &operator<<( QTextStream &strm, const LPair &prop ) |
313 | { | 313 | { |
314 | strm << prop.name << prop.value << "\""; | 314 | strm << prop.name << prop.value << "\""; |
315 | return strm; | 315 | return strm; |
316 | } | 316 | } |
317 | 317 | ||
318 | QTextStream &operator<<( QTextStream &strm, const SPair &prop ) | 318 | QTextStream &operator<<( QTextStream &strm, const SPair &prop ) |
319 | { | 319 | { |
320 | if ( !prop.value.isEmpty() ) | 320 | if ( !prop.value.isEmpty() ) |
321 | strm << prop.name << prop.value.latin1() << "\""; | 321 | strm << prop.name << prop.value.latin1() << "\""; |
322 | return strm; | 322 | return strm; |
323 | } | 323 | } |
324 | 324 | ||
325 | QTextStream &operator<<( QTextStream &strm, const XPair &prop ) | 325 | QTextStream &operator<<( QTextStream &strm, const XPair &prop ) |
@@ -338,1256 +338,1270 @@ VCCLCompilerTool::VCCLCompilerTool() | |||
338 | CallingConvention( callConventionDefault ), | 338 | CallingConvention( callConventionDefault ), |
339 | CompileAs( compileAsDefault ), | 339 | CompileAs( compileAsDefault ), |
340 | CompileAsManaged( managedDefault ), | 340 | CompileAsManaged( managedDefault ), |
341 | CompileOnly( unset ), | 341 | CompileOnly( unset ), |
342 | DebugInformationFormat( debugDisabled ), | 342 | DebugInformationFormat( debugDisabled ), |
343 | DefaultCharIsUnsigned( unset ), | 343 | DefaultCharIsUnsigned( unset ), |
344 | Detect64BitPortabilityProblems( unset ), | 344 | Detect64BitPortabilityProblems( unset ), |
345 | DisableLanguageExtensions( unset ), | 345 | DisableLanguageExtensions( unset ), |
346 | EnableFiberSafeOptimizations( unset ), | 346 | EnableFiberSafeOptimizations( unset ), |
347 | EnableFunctionLevelLinking( unset ), | 347 | EnableFunctionLevelLinking( unset ), |
348 | EnableIntrinsicFunctions( unset ), | 348 | EnableIntrinsicFunctions( unset ), |
349 | ExceptionHandling( unset ), | 349 | ExceptionHandling( unset ), |
350 | ExpandAttributedSource( unset ), | 350 | ExpandAttributedSource( unset ), |
351 | FavorSizeOrSpeed( favorNone ), | 351 | FavorSizeOrSpeed( favorNone ), |
352 | ForceConformanceInForLoopScope( unset ), | 352 | ForceConformanceInForLoopScope( unset ), |
353 | GeneratePreprocessedFile( preprocessNo ), | 353 | GeneratePreprocessedFile( preprocessNo ), |
354 | GlobalOptimizations( unset ), | 354 | GlobalOptimizations( unset ), |
355 | IgnoreStandardIncludePath( unset ), | 355 | IgnoreStandardIncludePath( unset ), |
356 | ImproveFloatingPointConsistency( unset ), | 356 | ImproveFloatingPointConsistency( unset ), |
357 | InlineFunctionExpansion( expandOnlyInline ), | 357 | InlineFunctionExpansion( expandOnlyInline ), |
358 | KeepComments( unset ), | 358 | KeepComments( unset ), |
359 | MinimalRebuild( unset ), | 359 | MinimalRebuild( unset ), |
360 | OmitFramePointers( unset ), | 360 | OmitFramePointers( unset ), |
361 | Optimization( optimizeDisabled ), | 361 | Optimization( optimizeDisabled ), |
362 | OptimizeForProcessor( procOptimizeBlended ), | 362 | OptimizeForProcessor( procOptimizeBlended ), |
363 | OptimizeForWindowsApplication( unset ), | 363 | OptimizeForWindowsApplication( unset ), |
364 | RuntimeLibrary( rtMultiThreaded ), | 364 | RuntimeLibrary( rtMultiThreaded ), |
365 | RuntimeTypeInfo( unset ), | 365 | RuntimeTypeInfo( unset ), |
366 | ShowIncludes( unset ), | 366 | ShowIncludes( unset ), |
367 | SmallerTypeCheck( unset ), | 367 | SmallerTypeCheck( unset ), |
368 | StringPooling( unset ), | 368 | StringPooling( unset ), |
369 | StructMemberAlignment( alignNotSet ), | 369 | StructMemberAlignment( alignNotSet ), |
370 | SuppressStartupBanner( unset ), | 370 | SuppressStartupBanner( unset ), |
371 | TreatWChar_tAsBuiltInType( unset ), | 371 | TreatWChar_tAsBuiltInType( unset ), |
372 | TurnOffAssemblyGeneration( unset ), | 372 | TurnOffAssemblyGeneration( unset ), |
373 | UndefineAllPreprocessorDefinitions( unset ), | 373 | UndefineAllPreprocessorDefinitions( unset ), |
374 | UsePrecompiledHeader( pchGenerateAuto ), | 374 | UsePrecompiledHeader( pchGenerateAuto ), |
375 | WarnAsError( unset ), | 375 | WarnAsError( unset ), |
376 | WarningLevel( warningLevel_0 ), | 376 | WarningLevel( warningLevel_0 ), |
377 | WholeProgramOptimization( unset ) | 377 | WholeProgramOptimization( unset ) |
378 | { | 378 | { |
379 | } | 379 | } |
380 | 380 | ||
381 | QTextStream &operator<<( QTextStream &strm, const VCCLCompilerTool &tool ) | 381 | QTextStream &operator<<( QTextStream &strm, const VCCLCompilerTool &tool ) |
382 | { | 382 | { |
383 | strm << _begTool3; | 383 | strm << _begTool3; |
384 | strm << _VCCLCompilerToolName; | 384 | strm << _VCCLCompilerToolName; |
385 | strm << XPair( _AdditionalIncludeDirectories, tool.AdditionalIncludeDirectories ); | 385 | strm << XPair( _AdditionalIncludeDirectories, tool.AdditionalIncludeDirectories ); |
386 | strm << XPair( _AdditionalOptions, tool.AdditionalOptions ); | 386 | strm << XPair( _AdditionalOptions, tool.AdditionalOptions, " " ); |
387 | strm << XPair( _AdditionalUsingDirectories, tool.AdditionalUsingDirectories ); | 387 | strm << XPair( _AdditionalUsingDirectories, tool.AdditionalUsingDirectories ); |
388 | strm << SPair( _AssemblerListingLocation, tool.AssemblerListingLocation ); | 388 | strm << SPair( _AssemblerListingLocation, tool.AssemblerListingLocation ); |
389 | if ( tool.AssemblerOutput != asmListingNone ) strm << EPair( _AssemblerOutput, tool.AssemblerOutput ); | 389 | if ( tool.AssemblerOutput != asmListingNone ) strm << EPair( _AssemblerOutput, tool.AssemblerOutput ); |
390 | if ( tool.BasicRuntimeChecks != runtimeBasicCheckNone ) strm << EPair( _BasicRuntimeChecks, tool.BasicRuntimeChecks ); | 390 | if ( tool.BasicRuntimeChecks != runtimeBasicCheckNone ) strm << EPair( _BasicRuntimeChecks, tool.BasicRuntimeChecks ); |
391 | if ( tool.BrowseInformation != brInfoNone ) strm << EPair( _BrowseInformation, tool.BrowseInformation ); | 391 | if ( tool.BrowseInformation != brInfoNone ) strm << EPair( _BrowseInformation, tool.BrowseInformation ); |
392 | strm << SPair( _BrowseInformationFile, tool.BrowseInformationFile ); | 392 | strm << SPair( _BrowseInformationFile, tool.BrowseInformationFile ); |
393 | strm << TPair( _BufferSecurityCheck, tool.BufferSecurityCheck ); | 393 | strm << TPair( _BufferSecurityCheck, tool.BufferSecurityCheck ); |
394 | if ( tool.CallingConvention != callConventionDefault ) strm << EPair( _CallingConvention, tool.CallingConvention ); | 394 | if ( tool.CallingConvention != callConventionDefault ) strm << EPair( _CallingConvention, tool.CallingConvention ); |
395 | if ( tool.CompileAs != compileAsDefault ) strm << EPair( _CompileAs, tool.CompileAs ); | 395 | if ( tool.CompileAs != compileAsDefault ) strm << EPair( _CompileAs, tool.CompileAs ); |
396 | if ( tool.CompileAsManaged != managedDefault ) strm << EPair( _CompileAsManaged, tool.CompileAsManaged ); | 396 | if ( tool.CompileAsManaged != managedDefault ) strm << EPair( _CompileAsManaged, tool.CompileAsManaged ); |
397 | strm << TPair( _CompileOnly, tool.CompileOnly ); | 397 | strm << TPair( _CompileOnly, tool.CompileOnly ); |
398 | strm << EPair( _DebugInformationFormat, tool.DebugInformationFormat ); | 398 | strm << EPair( _DebugInformationFormat, tool.DebugInformationFormat ); |
399 | strm << TPair( _DefaultCharIsUnsigned, tool.DefaultCharIsUnsigned ); | 399 | strm << TPair( _DefaultCharIsUnsigned, tool.DefaultCharIsUnsigned ); |
400 | strm << TPair( _Detect64BitPortabilityProblems, tool.Detect64BitPortabilityProblems ); | 400 | strm << TPair( _Detect64BitPortabilityProblems, tool.Detect64BitPortabilityProblems ); |
401 | strm << TPair( _DisableLanguageExtensions, tool.DisableLanguageExtensions ); | 401 | strm << TPair( _DisableLanguageExtensions, tool.DisableLanguageExtensions ); |
402 | strm << XPair( _DisableSpecificWarnings, tool.DisableSpecificWarnings ); | 402 | strm << XPair( _DisableSpecificWarnings, tool.DisableSpecificWarnings ); |
403 | strm << TPair( _EnableFiberSafeOptimizations, tool.EnableFiberSafeOptimizations ); | 403 | strm << TPair( _EnableFiberSafeOptimizations, tool.EnableFiberSafeOptimizations ); |
404 | strm << TPair( _EnableFunctionLevelLinking, tool.EnableFunctionLevelLinking ); | 404 | strm << TPair( _EnableFunctionLevelLinking, tool.EnableFunctionLevelLinking ); |
405 | strm << TPair( _EnableIntrinsicFunctions, tool.EnableIntrinsicFunctions ); | 405 | strm << TPair( _EnableIntrinsicFunctions, tool.EnableIntrinsicFunctions ); |
406 | strm << TPair( _ExceptionHandling, tool.ExceptionHandling ); | 406 | strm << TPair( _ExceptionHandling, tool.ExceptionHandling ); |
407 | strm << TPair( _ExpandAttributedSource, tool.ExpandAttributedSource ); | 407 | strm << TPair( _ExpandAttributedSource, tool.ExpandAttributedSource ); |
408 | if ( tool.FavorSizeOrSpeed != favorNone ) strm << EPair( _FavorSizeOrSpeed, tool.FavorSizeOrSpeed ); | 408 | if ( tool.FavorSizeOrSpeed != favorNone ) strm << EPair( _FavorSizeOrSpeed, tool.FavorSizeOrSpeed ); |
409 | strm << TPair( _ForceConformanceInForLoopScope, tool.ForceConformanceInForLoopScope ); | 409 | strm << TPair( _ForceConformanceInForLoopScope, tool.ForceConformanceInForLoopScope ); |
410 | strm << XPair( _ForcedIncludeFiles, tool.ForcedIncludeFiles ); | 410 | strm << XPair( _ForcedIncludeFiles, tool.ForcedIncludeFiles ); |
411 | strm << XPair( _ForcedUsingFiles, tool.ForcedUsingFiles ); | 411 | strm << XPair( _ForcedUsingFiles, tool.ForcedUsingFiles ); |
412 | strm << EPair( _GeneratePreprocessedFile, tool.GeneratePreprocessedFile ); | 412 | strm << EPair( _GeneratePreprocessedFile, tool.GeneratePreprocessedFile ); |
413 | strm << TPair( _GlobalOptimizations, tool.GlobalOptimizations ); | 413 | strm << TPair( _GlobalOptimizations, tool.GlobalOptimizations ); |
414 | strm << TPair( _IgnoreStandardIncludePath, tool.IgnoreStandardIncludePath ); | 414 | strm << TPair( _IgnoreStandardIncludePath, tool.IgnoreStandardIncludePath ); |
415 | strm << TPair( _ImproveFloatingPointConsistency, tool.ImproveFloatingPointConsistency ); | 415 | strm << TPair( _ImproveFloatingPointConsistency, tool.ImproveFloatingPointConsistency ); |
416 | strm << EPair( _InlineFunctionExpansion, tool.InlineFunctionExpansion ); | 416 | strm << EPair( _InlineFunctionExpansion, tool.InlineFunctionExpansion ); |
417 | strm << TPair( _KeepComments, tool.KeepComments ); | 417 | strm << TPair( _KeepComments, tool.KeepComments ); |
418 | strm << TPair( _MinimalRebuild, tool.MinimalRebuild ); | 418 | strm << TPair( _MinimalRebuild, tool.MinimalRebuild ); |
419 | strm << SPair( _ObjectFile, tool.ObjectFile ); | 419 | strm << SPair( _ObjectFile, tool.ObjectFile ); |
420 | strm << TPair( _OmitFramePointers, tool.OmitFramePointers ); | 420 | strm << TPair( _OmitFramePointers, tool.OmitFramePointers ); |
421 | strm << EPair( _Optimization, tool.Optimization ); | 421 | strm << EPair( _Optimization, tool.Optimization ); |
422 | if ( tool.OptimizeForProcessor != procOptimizeBlended ) strm << EPair( _OptimizeForProcessor, tool.OptimizeForProcessor ); | 422 | if ( tool.OptimizeForProcessor != procOptimizeBlended ) strm << EPair( _OptimizeForProcessor, tool.OptimizeForProcessor ); |
423 | strm << TPair( _OptimizeForWindowsApplication, tool.OptimizeForWindowsApplication ); | 423 | strm << TPair( _OptimizeForWindowsApplication, tool.OptimizeForWindowsApplication ); |
424 | strm << SPair( _OutputFile, tool.OutputFile ); | 424 | strm << SPair( _OutputFile, tool.OutputFile ); |
425 | strm << SPair( _PrecompiledHeaderFile, tool.PrecompiledHeaderFile ); | 425 | strm << SPair( _PrecompiledHeaderFile, tool.PrecompiledHeaderFile ); |
426 | strm << SPair( _PrecompiledHeaderThrough, tool.PrecompiledHeaderThrough ); | 426 | strm << SPair( _PrecompiledHeaderThrough, tool.PrecompiledHeaderThrough ); |
427 | strm << XPair( _PreprocessorDefinitions, tool.PreprocessorDefinitions ); | 427 | strm << XPair( _PreprocessorDefinitions, tool.PreprocessorDefinitions ); |
428 | strm << SPair( _ProgramDataBaseFileName, tool.ProgramDataBaseFileName ); | 428 | strm << SPair( _ProgramDataBaseFileName, tool.ProgramDataBaseFileName ); |
429 | strm << EPair( _RuntimeLibrary, tool.RuntimeLibrary ); | 429 | strm << EPair( _RuntimeLibrary, tool.RuntimeLibrary ); |
430 | strm << TPair( _RuntimeTypeInfo, tool.RuntimeTypeInfo ); | 430 | strm << TPair( _RuntimeTypeInfo, tool.RuntimeTypeInfo ); |
431 | strm << TPair( _ShowIncludes, tool.ShowIncludes ); | 431 | strm << TPair( _ShowIncludes, tool.ShowIncludes ); |
432 | strm << TPair( _SmallerTypeCheck, tool.SmallerTypeCheck ); | 432 | strm << TPair( _SmallerTypeCheck, tool.SmallerTypeCheck ); |
433 | strm << TPair( _StringPooling, tool.StringPooling ); | 433 | strm << TPair( _StringPooling, tool.StringPooling ); |
434 | if ( tool.StructMemberAlignment != alignNotSet ) strm << EPair( _StructMemberAlignment, tool.StructMemberAlignment ); | 434 | if ( tool.StructMemberAlignment != alignNotSet ) strm << EPair( _StructMemberAlignment, tool.StructMemberAlignment ); |
435 | strm << TPair( _SuppressStartupBanner, tool.SuppressStartupBanner ); | 435 | strm << TPair( _SuppressStartupBanner, tool.SuppressStartupBanner ); |
436 | strm << TPair( _TreatWChar_tAsBuiltInType, tool.TreatWChar_tAsBuiltInType ); | 436 | strm << TPair( _TreatWChar_tAsBuiltInType, tool.TreatWChar_tAsBuiltInType ); |
437 | strm << TPair( _TurnOffAssemblyGeneration, tool.TurnOffAssemblyGeneration ); | 437 | strm << TPair( _TurnOffAssemblyGeneration, tool.TurnOffAssemblyGeneration ); |
438 | strm << TPair( _UndefineAllPreprocessorDefinitions, tool.UndefineAllPreprocessorDefinitions ); | 438 | strm << TPair( _UndefineAllPreprocessorDefinitions, tool.UndefineAllPreprocessorDefinitions ); |
439 | strm << XPair( _UndefinePreprocessorDefinitions, tool.UndefinePreprocessorDefinitions ); | 439 | strm << XPair( _UndefinePreprocessorDefinitions, tool.UndefinePreprocessorDefinitions ); |
440 | if ( !tool.PrecompiledHeaderFile.isEmpty() || | 440 | if ( !tool.PrecompiledHeaderFile.isEmpty() || |
441 | !tool.PrecompiledHeaderThrough.isEmpty() ) | 441 | !tool.PrecompiledHeaderThrough.isEmpty() ) |
442 | strm << EPair( _UsePrecompiledHeader, tool.UsePrecompiledHeader ); | 442 | strm << EPair( _UsePrecompiledHeader, tool.UsePrecompiledHeader ); |
443 | strm << TPair( _WarnAsError, tool.WarnAsError ); | 443 | strm << TPair( _WarnAsError, tool.WarnAsError ); |
444 | strm << EPair( _WarningLevel, tool.WarningLevel ); | 444 | strm << EPair( _WarningLevel, tool.WarningLevel ); |
445 | strm << TPair( _WholeProgramOptimization, tool.WholeProgramOptimization ); | 445 | strm << TPair( _WholeProgramOptimization, tool.WholeProgramOptimization ); |
446 | strm << "/>"; | 446 | strm << "/>"; |
447 | return strm; | 447 | return strm; |
448 | } | 448 | } |
449 | 449 | ||
450 | bool VCCLCompilerTool::parseOption( const char* option ) | 450 | bool VCCLCompilerTool::parseOption( const char* option ) |
451 | { | 451 | { |
452 | // skip index 0 ('/' or '-') | 452 | // skip index 0 ('/' or '-') |
453 | char first = option[1]; | 453 | char first = option[1]; |
454 | char second = option[2]; | 454 | char second = option[2]; |
455 | char third = option[3]; | 455 | char third = option[3]; |
456 | char fourth = option[4]; | 456 | char fourth = option[4]; |
457 | bool found = TRUE; | ||
457 | 458 | ||
458 | switch ( first ) { | 459 | switch ( first ) { |
459 | case '?': | 460 | case '?': |
460 | case 'h': | 461 | case 'h': |
461 | qWarning( "Generator: Option '/?', '/help': MSVC.NET projects do not support outputting help info" ); | 462 | qWarning( "Generator: Option '/?', '/help': MSVC.NET projects do not support outputting help info" ); |
462 | return FALSE; | 463 | found = FALSE; |
464 | break; | ||
463 | case '@': | 465 | case '@': |
464 | qWarning( "Generator: Option '/@': MSVC.NET projects do not support the use of a response file" ); | 466 | qWarning( "Generator: Option '/@': MSVC.NET projects do not support the use of a response file" ); |
465 | return FALSE; | 467 | found = FALSE; |
468 | break; | ||
466 | case 'l': | 469 | case 'l': |
467 | qWarning( "Generator: Option '/link': qmake generator does not support passing link options through the compiler tool" ); | 470 | qWarning( "Generator: Option '/link': qmake generator does not support passing link options through the compiler tool" ); |
468 | return FALSE; | 471 | found = FALSE; |
469 | 472 | break; | |
470 | case 'A': | 473 | case 'A': |
471 | if ( second != 'I' ) | 474 | if ( second != 'I' ) { |
472 | return FALSE; | 475 | found = FALSE; break; |
476 | } | ||
473 | AdditionalUsingDirectories += option+2; | 477 | AdditionalUsingDirectories += option+2; |
474 | break; | 478 | break; |
475 | case 'C': | 479 | case 'C': |
476 | KeepComments = _True; | 480 | KeepComments = _True; |
477 | break; | 481 | break; |
478 | case 'D': | 482 | case 'D': |
479 | PreprocessorDefinitions += option+1; | 483 | PreprocessorDefinitions += option+1; |
480 | break; | 484 | break; |
481 | case 'E': | 485 | case 'E': |
482 | if ( second == 'H' ) { | 486 | if ( second == 'H' ) { |
483 | if ( third == 'a' || third == 'c' || third == 's' ) { | 487 | if ( third == 'a' || third == 'c' || third == 's' ) { |
484 | // ExceptionHandling must be false, or it will override | 488 | // ExceptionHandling must be false, or it will override |
485 | // with an /EHsc option | 489 | // with an /EHsc option |
486 | ExceptionHandling = _False; | 490 | ExceptionHandling = _False; |
487 | AdditionalOptions += option; | 491 | AdditionalOptions += option; |
488 | break; | 492 | break; |
489 | } | 493 | } |
490 | return FALSE; | 494 | found = FALSE; break; |
491 | } | 495 | } |
492 | GeneratePreprocessedFile = preprocessYes; | 496 | GeneratePreprocessedFile = preprocessYes; |
493 | break; | 497 | break; |
494 | case 'F': | 498 | case 'F': |
495 | if ( second <= '9' && second >= '0' ) { | 499 | if ( second <= '9' && second >= '0' ) { |
496 | AdditionalOptions += option; | 500 | AdditionalOptions += option; |
497 | break; | 501 | break; |
498 | } else { | 502 | } else { |
499 | switch ( second ) { | 503 | switch ( second ) { |
500 | case 'A': | 504 | case 'A': |
501 | if ( third == 'c' ) { | 505 | if ( third == 'c' ) { |
502 | AssemblerOutput = asmListingAsmMachine; | 506 | AssemblerOutput = asmListingAsmMachine; |
503 | if ( fourth == 's' ) | 507 | if ( fourth == 's' ) |
504 | AssemblerOutput = asmListingAsmMachineSrc; | 508 | AssemblerOutput = asmListingAsmMachineSrc; |
505 | } else if ( third == 's' ) { | 509 | } else if ( third == 's' ) { |
506 | AssemblerOutput = asmListingAsmSrc; | 510 | AssemblerOutput = asmListingAsmSrc; |
507 | } else { | 511 | } else { |
508 | AssemblerOutput = asmListingAssemblyOnly; | 512 | AssemblerOutput = asmListingAssemblyOnly; |
509 | } | 513 | } |
510 | break; | 514 | break; |
511 | case 'a': | 515 | case 'a': |
512 | AssemblerListingLocation = option+3; | 516 | AssemblerListingLocation = option+3; |
513 | break; | 517 | break; |
514 | case 'I': | 518 | case 'I': |
515 | ForcedIncludeFiles += option+3; | 519 | ForcedIncludeFiles += option+3; |
516 | break; | 520 | break; |
517 | case 'R': | 521 | case 'R': |
518 | BrowseInformation = brAllInfo; | 522 | BrowseInformation = brAllInfo; |
519 | BrowseInformationFile = option+3; | 523 | BrowseInformationFile = option+3; |
520 | break; | 524 | break; |
521 | case 'r': | 525 | case 'r': |
522 | BrowseInformation = brNoLocalSymbols; | 526 | BrowseInformation = brNoLocalSymbols; |
523 | BrowseInformationFile = option+3; | 527 | BrowseInformationFile = option+3; |
524 | break; | 528 | break; |
525 | case 'U': | 529 | case 'U': |
526 | ForcedUsingFiles += option+3; | 530 | ForcedUsingFiles += option+3; |
527 | break; | 531 | break; |
528 | case 'd': | 532 | case 'd': |
529 | ProgramDataBaseFileName = option+3; | 533 | ProgramDataBaseFileName = option+3; |
530 | break; | 534 | break; |
531 | case 'e': | 535 | case 'e': |
532 | OutputFile = option+3; | 536 | OutputFile = option+3; |
533 | break; | 537 | break; |
534 | case 'm': | 538 | case 'm': |
535 | AdditionalOptions += option; | 539 | AdditionalOptions += option; |
536 | break; | 540 | break; |
537 | case 'o': | 541 | case 'o': |
538 | ObjectFile = option+3; | 542 | ObjectFile = option+3; |
539 | break; | 543 | break; |
540 | case 'p': | 544 | case 'p': |
541 | PrecompiledHeaderFile = option+3; | 545 | PrecompiledHeaderFile = option+3; |
542 | break; | 546 | break; |
543 | case 'x': | 547 | case 'x': |
544 | ExpandAttributedSource = _True; | 548 | ExpandAttributedSource = _True; |
545 | break; | 549 | break; |
546 | default: | 550 | default: |
547 | return FALSE; | 551 | found = FALSE; break; |
548 | } | 552 | } |
549 | } | 553 | } |
550 | break; | 554 | break; |
551 | case 'G': | 555 | case 'G': |
552 | switch ( second ) { | 556 | switch ( second ) { |
553 | case '3': | 557 | case '3': |
554 | case '4': | 558 | case '4': |
555 | qWarning( "Option '/G3' and '/G4' were phased out in Visual C++ 5.0" ); | 559 | qWarning( "Option '/G3' and '/G4' were phased out in Visual C++ 5.0" ); |
556 | return FALSE; | 560 | found = FALSE; break; |
557 | case '5': | 561 | case '5': |
558 | OptimizeForProcessor = procOptimizePentium; | 562 | OptimizeForProcessor = procOptimizePentium; |
559 | break; | 563 | break; |
560 | case '6': | 564 | case '6': |
561 | case 'B': | 565 | case 'B': |
562 | OptimizeForProcessor = procOptimizePentiumProAndAbove; | 566 | OptimizeForProcessor = procOptimizePentiumProAndAbove; |
563 | break; | 567 | break; |
564 | case 'A': | 568 | case 'A': |
565 | OptimizeForWindowsApplication = _True; | 569 | OptimizeForWindowsApplication = _True; |
566 | break; | 570 | break; |
567 | case 'F': | 571 | case 'F': |
568 | StringPooling = _True; | 572 | StringPooling = _True; |
569 | break; | 573 | break; |
570 | case 'H': | 574 | case 'H': |
571 | AdditionalOptions += option; | 575 | AdditionalOptions += option; |
572 | break; | 576 | break; |
573 | case 'L': | 577 | case 'L': |
574 | WholeProgramOptimization = _True; | 578 | WholeProgramOptimization = _True; |
575 | if ( third == '-' ) | 579 | if ( third == '-' ) |
576 | WholeProgramOptimization = _False; | 580 | WholeProgramOptimization = _False; |
577 | break; | 581 | break; |
578 | case 'R': | 582 | case 'R': |
579 | RuntimeTypeInfo = _True; | 583 | RuntimeTypeInfo = _True; |
580 | if ( third == '-' ) | 584 | if ( third == '-' ) |
581 | RuntimeTypeInfo = _False; | 585 | RuntimeTypeInfo = _False; |
582 | break; | 586 | break; |
583 | case 'S': | 587 | case 'S': |
584 | BufferSecurityCheck = _True; | 588 | BufferSecurityCheck = _True; |
585 | break; | 589 | break; |
586 | case 'T': | 590 | case 'T': |
587 | EnableFiberSafeOptimizations = _True; | 591 | EnableFiberSafeOptimizations = _True; |
588 | break; | 592 | break; |
589 | case 'X': | 593 | case 'X': |
590 | case 'Z': | 594 | case 'Z': |
591 | case 'e': | 595 | case 'e': |
592 | case 'h': | 596 | case 'h': |
593 | AdditionalOptions += option; | 597 | AdditionalOptions += option; |
594 | break; | 598 | break; |
595 | case 'd': | 599 | case 'd': |
596 | CallingConvention = callConventionCDecl; | 600 | CallingConvention = callConventionCDecl; |
597 | break; | 601 | break; |
598 | case 'f': | 602 | case 'f': |
599 | StringPooling = _True; | 603 | StringPooling = _True; |
600 | AdditionalOptions += option; | 604 | AdditionalOptions += option; |
601 | break; | 605 | break; |
602 | case 'm': | 606 | case 'm': |
603 | MinimalRebuild = _True; | 607 | MinimalRebuild = _True; |
604 | if ( third == '-' ) | 608 | if ( third == '-' ) |
605 | MinimalRebuild = _False; | 609 | MinimalRebuild = _False; |
606 | break; | 610 | break; |
607 | case 'r': | 611 | case 'r': |
608 | CallingConvention = callConventionFastCall; | 612 | CallingConvention = callConventionFastCall; |
609 | break; | 613 | break; |
610 | case 's': | 614 | case 's': |
611 | // Warning: following [num] is not used, | 615 | // Warning: following [num] is not used, |
612 | // were should we put it? | 616 | // were should we put it? |
613 | BufferSecurityCheck = _True; | 617 | BufferSecurityCheck = _True; |
614 | break; | 618 | break; |
615 | case 'y': | 619 | case 'y': |
616 | EnableFunctionLevelLinking = _True; | 620 | EnableFunctionLevelLinking = _True; |
617 | break; | 621 | break; |
618 | case 'z': | 622 | case 'z': |
619 | CallingConvention = callConventionStdCall; | 623 | CallingConvention = callConventionStdCall; |
620 | break; | 624 | break; |
621 | default: | 625 | default: |
622 | return FALSE; | 626 | found = FALSE; break; |
623 | } | 627 | } |
624 | break; | 628 | break; |
625 | case 'H': | 629 | case 'H': |
626 | AdditionalOptions += option; | 630 | AdditionalOptions += option; |
627 | break; | 631 | break; |
628 | case 'I': | 632 | case 'I': |
629 | AdditionalIncludeDirectories += option+2; | 633 | AdditionalIncludeDirectories += option+2; |
630 | break; | 634 | break; |
631 | case 'L': | 635 | case 'L': |
632 | if ( second == 'D' ) { | 636 | if ( second == 'D' ) { |
633 | AdditionalOptions += option; | 637 | AdditionalOptions += option; |
634 | break; | 638 | break; |
635 | } | 639 | } |
636 | return FALSE; | 640 | found = FALSE; break; |
637 | case 'M': | 641 | case 'M': |
638 | if ( second == 'D' ) { | 642 | if ( second == 'D' ) { |
639 | RuntimeLibrary = rtMultiThreadedDLL; | 643 | RuntimeLibrary = rtMultiThreadedDLL; |
640 | if ( third == 'd' ) | 644 | if ( third == 'd' ) |
641 | RuntimeLibrary = rtMultiThreadedDebugDLL; | 645 | RuntimeLibrary = rtMultiThreadedDebugDLL; |
642 | break; | 646 | break; |
643 | } else if ( second == 'L' ) { | 647 | } else if ( second == 'L' ) { |
644 | RuntimeLibrary = rtSingleThreaded; | 648 | RuntimeLibrary = rtSingleThreaded; |
645 | if ( third == 'd' ) | 649 | if ( third == 'd' ) |
646 | RuntimeLibrary = rtSingleThreadedDebug; | 650 | RuntimeLibrary = rtSingleThreadedDebug; |
647 | break; | 651 | break; |
648 | } else if ( second == 'T' ) { | 652 | } else if ( second == 'T' ) { |
649 | RuntimeLibrary = rtMultiThreaded; | 653 | RuntimeLibrary = rtMultiThreaded; |
650 | if ( third == 'd' ) | 654 | if ( third == 'd' ) |
651 | RuntimeLibrary = rtMultiThreadedDebug; | 655 | RuntimeLibrary = rtMultiThreadedDebug; |
652 | break; | 656 | break; |
653 | } | 657 | } |
654 | return FALSE; | 658 | found = FALSE; break; |
655 | case 'O': | 659 | case 'O': |
656 | switch ( second ) { | 660 | switch ( second ) { |
657 | case '1': | 661 | case '1': |
658 | Optimization = optimizeMinSpace; | 662 | Optimization = optimizeMinSpace; |
659 | break; | 663 | break; |
660 | case '2': | 664 | case '2': |
661 | Optimization = optimizeMaxSpeed; | 665 | Optimization = optimizeMaxSpeed; |
662 | break; | 666 | break; |
663 | case 'a': | 667 | case 'a': |
664 | AdditionalOptions += option; | 668 | AdditionalOptions += option; |
665 | break; | 669 | break; |
666 | case 'b': | 670 | case 'b': |
667 | if ( third == '0' ) | 671 | if ( third == '0' ) |
668 | InlineFunctionExpansion = expandDisable; | 672 | InlineFunctionExpansion = expandDisable; |
669 | else if ( third == '1' ) | 673 | else if ( third == '1' ) |
670 | InlineFunctionExpansion = expandOnlyInline; | 674 | InlineFunctionExpansion = expandOnlyInline; |
671 | else if ( third == '2' ) | 675 | else if ( third == '2' ) |
672 | InlineFunctionExpansion = expandAnySuitable; | 676 | InlineFunctionExpansion = expandAnySuitable; |
673 | else | 677 | else |
674 | return FALSE; | 678 | found = FALSE; |
675 | break; | 679 | break; |
676 | case 'd': | 680 | case 'd': |
677 | Optimization = optimizeDisabled; | 681 | Optimization = optimizeDisabled; |
678 | break; | 682 | break; |
679 | case 'g': | 683 | case 'g': |
680 | GlobalOptimizations = _True; | 684 | GlobalOptimizations = _True; |
681 | break; | 685 | break; |
682 | case 'i': | 686 | case 'i': |
683 | EnableIntrinsicFunctions = _True; | 687 | EnableIntrinsicFunctions = _True; |
684 | break; | 688 | break; |
685 | case 'p': | 689 | case 'p': |
686 | ImproveFloatingPointConsistency = _True; | 690 | ImproveFloatingPointConsistency = _True; |
687 | if ( third == '-' ) | 691 | if ( third == '-' ) |
688 | ImproveFloatingPointConsistency = _False; | 692 | ImproveFloatingPointConsistency = _False; |
689 | break; | 693 | break; |
690 | case 's': | 694 | case 's': |
691 | FavorSizeOrSpeed = favorSize; | 695 | FavorSizeOrSpeed = favorSize; |
692 | break; | 696 | break; |
693 | case 't': | 697 | case 't': |
694 | FavorSizeOrSpeed = favorSpeed; | 698 | FavorSizeOrSpeed = favorSpeed; |
695 | break; | 699 | break; |
696 | case 'w': | 700 | case 'w': |
697 | AdditionalOptions += option; | 701 | AdditionalOptions += option; |
698 | break; | 702 | break; |
699 | case 'x': | 703 | case 'x': |
700 | Optimization = optimizeFull; | 704 | Optimization = optimizeFull; |
701 | break; | 705 | break; |
702 | case 'y': | 706 | case 'y': |
703 | OmitFramePointers = _True; | 707 | OmitFramePointers = _True; |
704 | if ( third == '-' ) | 708 | if ( third == '-' ) |
705 | OmitFramePointers = _False; | 709 | OmitFramePointers = _False; |
706 | break; | 710 | break; |
707 | default: | 711 | default: |
708 | return FALSE; | 712 | found = FALSE; break; |
709 | } | 713 | } |
710 | break; | 714 | break; |
711 | case 'P': | 715 | case 'P': |
712 | GeneratePreprocessedFile = preprocessYes; | 716 | GeneratePreprocessedFile = preprocessYes; |
713 | break; | 717 | break; |
714 | case 'Q': | 718 | case 'Q': |
715 | if ( second == 'I' ) { | 719 | if ( second == 'I' ) { |
716 | AdditionalOptions += option; | 720 | AdditionalOptions += option; |
717 | break; | 721 | break; |
718 | } | 722 | } |
719 | return FALSE; | 723 | found = FALSE; break; |
720 | case 'R': | 724 | case 'R': |
721 | if ( second == 'T' && third == 'C' ) { | 725 | if ( second == 'T' && third == 'C' ) { |
722 | if ( fourth == '1' ) | 726 | if ( fourth == '1' ) |
723 | BasicRuntimeChecks = runtimeBasicCheckAll; | 727 | BasicRuntimeChecks = runtimeBasicCheckAll; |
724 | else if ( fourth == 'c' ) | 728 | else if ( fourth == 'c' ) |
725 | SmallerTypeCheck = _True; | 729 | SmallerTypeCheck = _True; |
726 | else if ( fourth == 's' ) | 730 | else if ( fourth == 's' ) |
727 | BasicRuntimeChecks = runtimeCheckStackFrame; | 731 | BasicRuntimeChecks = runtimeCheckStackFrame; |
728 | else if ( fourth == 'u' ) | 732 | else if ( fourth == 'u' ) |
729 | BasicRuntimeChecks = runtimeCheckUninitVariables; | 733 | BasicRuntimeChecks = runtimeCheckUninitVariables; |
730 | else | 734 | else |
731 | return FALSE; | 735 | found = FALSE; break; |
732 | } | 736 | } |
733 | break; | 737 | break; |
734 | case 'T': | 738 | case 'T': |
735 | if ( second == 'C' ) { | 739 | if ( second == 'C' ) { |
736 | CompileAs = compileAsC; | 740 | CompileAs = compileAsC; |
737 | } else if ( second == 'P' ) { | 741 | } else if ( second == 'P' ) { |
738 | CompileAs = compileAsCPlusPlus; | 742 | CompileAs = compileAsCPlusPlus; |
739 | } else { | 743 | } else { |
740 | qWarning( "Generator: Options '/Tp<filename>' and '/Tc<filename>' are not supported by qmake" ); | 744 | qWarning( "Generator: Options '/Tp<filename>' and '/Tc<filename>' are not supported by qmake" ); |
741 | return FALSE; | 745 | found = FALSE; break; |
742 | } | 746 | } |
743 | break; | 747 | break; |
744 | case 'U': | 748 | case 'U': |
745 | UndefinePreprocessorDefinitions += option+2; | 749 | UndefinePreprocessorDefinitions += option+2; |
746 | break; | 750 | break; |
747 | case 'V': | 751 | case 'V': |
748 | AdditionalOptions += option; | 752 | AdditionalOptions += option; |
749 | break; | 753 | break; |
750 | case 'W': | 754 | case 'W': |
751 | switch ( second ) { | 755 | switch ( second ) { |
752 | case 'a': | 756 | case 'a': |
753 | case '4': | 757 | case '4': |
754 | WarningLevel = warningLevel_4; | 758 | WarningLevel = warningLevel_4; |
755 | break; | 759 | break; |
756 | case '3': | 760 | case '3': |
757 | WarningLevel = warningLevel_3; | 761 | WarningLevel = warningLevel_3; |
758 | break; | 762 | break; |
759 | case '2': | 763 | case '2': |
760 | WarningLevel = warningLevel_2; | 764 | WarningLevel = warningLevel_2; |
761 | break; | 765 | break; |
762 | case '1': | 766 | case '1': |
763 | WarningLevel = warningLevel_1; | 767 | WarningLevel = warningLevel_1; |
764 | break; | 768 | break; |
765 | case '0': | 769 | case '0': |
766 | WarningLevel = warningLevel_0; | 770 | WarningLevel = warningLevel_0; |
767 | break; | 771 | break; |
768 | case 'L': | 772 | case 'L': |
769 | AdditionalOptions += option; | 773 | AdditionalOptions += option; |
770 | break; | 774 | break; |
771 | case 'X': | 775 | case 'X': |
772 | WarnAsError = _True; | 776 | WarnAsError = _True; |
773 | break; | 777 | break; |
774 | case 'p': | 778 | case 'p': |
775 | if ( third == '6' && fourth == '4' ) { | 779 | if ( third == '6' && fourth == '4' ) { |
776 | Detect64BitPortabilityProblems = _True; | 780 | Detect64BitPortabilityProblems = _True; |
777 | break; | 781 | break; |
778 | } | 782 | } |
779 | // Fallthrough | 783 | // Fallthrough |
780 | default: | 784 | default: |
781 | return FALSE; | 785 | found = FALSE; break; |
782 | } | 786 | } |
783 | break; | 787 | break; |
784 | case 'X': | 788 | case 'X': |
785 | IgnoreStandardIncludePath = _True; | 789 | IgnoreStandardIncludePath = _True; |
786 | break; | 790 | break; |
787 | case 'Y': | 791 | case 'Y': |
788 | switch ( second ) { | 792 | switch ( second ) { |
789 | case '\0': | 793 | case '\0': |
790 | case '-': | 794 | case '-': |
791 | AdditionalOptions += option; | 795 | AdditionalOptions += option; |
792 | break; | 796 | break; |
793 | case 'X': | 797 | case 'X': |
794 | UsePrecompiledHeader = pchGenerateAuto; | 798 | UsePrecompiledHeader = pchGenerateAuto; |
795 | PrecompiledHeaderFile = option+3; | 799 | PrecompiledHeaderFile = option+3; |
796 | break; | 800 | break; |
797 | case 'c': | 801 | case 'c': |
798 | UsePrecompiledHeader = pchCreateUsingSpecific; | 802 | UsePrecompiledHeader = pchCreateUsingSpecific; |
799 | PrecompiledHeaderFile = option+3; | 803 | PrecompiledHeaderFile = option+3; |
800 | break; | 804 | break; |
801 | case 'd': | 805 | case 'd': |
802 | case 'l': | 806 | case 'l': |
803 | AdditionalOptions =+ option; | 807 | AdditionalOptions =+ option; |
804 | break; | 808 | break; |
805 | case 'u': | 809 | case 'u': |
806 | UsePrecompiledHeader = pchUseUsingSpecific; | 810 | UsePrecompiledHeader = pchUseUsingSpecific; |
807 | PrecompiledHeaderFile = option+3; | 811 | PrecompiledHeaderFile = option+3; |
808 | break; | 812 | break; |
809 | default: | 813 | default: |
810 | return FALSE; | 814 | found = FALSE; break; |
811 | } | 815 | } |
812 | break; | 816 | break; |
813 | case 'Z': | 817 | case 'Z': |
814 | switch ( second ) { | 818 | switch ( second ) { |
815 | case '7': | 819 | case '7': |
816 | DebugInformationFormat = debugOldStyleInfo; | 820 | DebugInformationFormat = debugOldStyleInfo; |
817 | break; | 821 | break; |
818 | case 'I': | 822 | case 'I': |
819 | DebugInformationFormat = debugEditAndContinue; | 823 | DebugInformationFormat = debugEditAndContinue; |
820 | break; | 824 | break; |
821 | case 'd': | 825 | case 'd': |
822 | DebugInformationFormat = debugLineInfoOnly; | 826 | DebugInformationFormat = debugLineInfoOnly; |
823 | break; | 827 | break; |
824 | case 'i': | 828 | case 'i': |
825 | DebugInformationFormat = debugEnabled; | 829 | DebugInformationFormat = debugEnabled; |
826 | break; | 830 | break; |
827 | case 'l': | 831 | case 'l': |
828 | DebugInformationFormat = debugEditAndContinue; | 832 | DebugInformationFormat = debugEditAndContinue; |
829 | break; | 833 | break; |
830 | case 'a': | 834 | case 'a': |
831 | DisableLanguageExtensions = _True; | 835 | DisableLanguageExtensions = _True; |
832 | break; | 836 | break; |
833 | case 'e': | 837 | case 'e': |
834 | DisableLanguageExtensions = _False; | 838 | DisableLanguageExtensions = _False; |
835 | break; | 839 | break; |
836 | case 'c': | 840 | case 'c': |
837 | if ( third == ':' ) { | 841 | if ( third == ':' ) { |
838 | if ( fourth == 'f' ) | 842 | if ( fourth == 'f' ) |
839 | ForceConformanceInForLoopScope = _True; | 843 | ForceConformanceInForLoopScope = _True; |
840 | else if ( fourth == 'w' ) | 844 | else if ( fourth == 'w' ) |
841 | TreatWChar_tAsBuiltInType = _True; | 845 | TreatWChar_tAsBuiltInType = _True; |
842 | else | 846 | else |
843 | return FALSE; | 847 | found = FALSE; |
844 | } else { | 848 | } else { |
845 | return FALSE; | 849 | found = FALSE; break; |
846 | } | 850 | } |
847 | break; | 851 | break; |
848 | case 'g': | 852 | case 'g': |
849 | case 'm': | 853 | case 'm': |
850 | case 's': | 854 | case 's': |
851 | AdditionalOptions += option; | 855 | AdditionalOptions += option; |
852 | break; | 856 | break; |
853 | case 'p': | 857 | case 'p': |
854 | switch ( third ) | 858 | switch ( third ) |
855 | { | 859 | { |
856 | case '\0': | 860 | case '\0': |
857 | case '1': | 861 | case '1': |
858 | StructMemberAlignment = alignSingleByte; | 862 | StructMemberAlignment = alignSingleByte; |
859 | if ( fourth == '6' ) | 863 | if ( fourth == '6' ) |
860 | StructMemberAlignment = alignSixteenBytes; | 864 | StructMemberAlignment = alignSixteenBytes; |
861 | break; | 865 | break; |
862 | case '2': | 866 | case '2': |
863 | StructMemberAlignment = alignTwoBytes; | 867 | StructMemberAlignment = alignTwoBytes; |
864 | break; | 868 | break; |
865 | case '4': | 869 | case '4': |
866 | StructMemberAlignment = alignFourBytes; | 870 | StructMemberAlignment = alignFourBytes; |
867 | break; | 871 | break; |
868 | case '8': | 872 | case '8': |
869 | StructMemberAlignment = alignEightBytes; | 873 | StructMemberAlignment = alignEightBytes; |
870 | break; | 874 | break; |
871 | default: | 875 | default: |
872 | return FALSE; | 876 | found = FALSE; break; |
873 | } | 877 | } |
874 | break; | 878 | break; |
875 | default: | 879 | default: |
876 | return FALSE; | 880 | found = FALSE; break; |
877 | } | 881 | } |
878 | break; | 882 | break; |
879 | case 'c': | 883 | case 'c': |
880 | if ( second == '\0' ) { | 884 | if ( second == '\0' ) { |
881 | CompileOnly = _True; | 885 | CompileOnly = _True; |
882 | } else if ( second == 'l' ) { | 886 | } else if ( second == 'l' ) { |
883 | if ( *(option+5) == 'n' ) { | 887 | if ( *(option+5) == 'n' ) { |
884 | CompileAsManaged = managedAssembly; | 888 | CompileAsManaged = managedAssembly; |
885 | TurnOffAssemblyGeneration = _True; | 889 | TurnOffAssemblyGeneration = _True; |
886 | } else { | 890 | } else { |
887 | CompileAsManaged = managedAssembly; | 891 | CompileAsManaged = managedAssembly; |
888 | } | 892 | } |
889 | } else { | 893 | } else { |
890 | return FALSE; | 894 | found = FALSE; break; |
891 | } | 895 | } |
892 | break; | 896 | break; |
893 | case 'd': | 897 | case 'd': |
894 | if ( second != 'r' ) | 898 | if ( second != 'r' ) { |
895 | return FALSE; | 899 | found = FALSE; break; |
900 | } | ||
896 | CompileAsManaged = managedAssembly; | 901 | CompileAsManaged = managedAssembly; |
897 | break; | 902 | break; |
898 | case 'n': | 903 | case 'n': |
899 | if ( second == 'o' && third == 'B' && fourth == 'o' ) { | 904 | if ( second == 'o' && third == 'B' && fourth == 'o' ) { |
900 | AdditionalOptions += "/noBool"; | 905 | AdditionalOptions += "/noBool"; |
901 | break; | 906 | break; |
902 | } | 907 | } |
903 | if ( second == 'o' && third == 'l' && fourth == 'o' ) { | 908 | if ( second == 'o' && third == 'l' && fourth == 'o' ) { |
904 | SuppressStartupBanner = _True; | 909 | SuppressStartupBanner = _True; |
905 | break; | 910 | break; |
906 | } | 911 | } |
907 | return FALSE; | 912 | found = FALSE; break; |
908 | case 's': | 913 | case 's': |
909 | if ( second == 'h' && third == 'o' && fourth == 'w' ) { | 914 | if ( second == 'h' && third == 'o' && fourth == 'w' ) { |
910 | ShowIncludes = _True; | 915 | ShowIncludes = _True; |
911 | break; | 916 | break; |
912 | } | 917 | } |
913 | return FALSE; | 918 | found = FALSE; break; |
914 | case 'u': | 919 | case 'u': |
915 | UndefineAllPreprocessorDefinitions = _True; | 920 | UndefineAllPreprocessorDefinitions = _True; |
916 | break; | 921 | break; |
917 | case 'v': | 922 | case 'v': |
918 | if ( second == 'd' || second == 'm' ) { | 923 | if ( second == 'd' || second == 'm' ) { |
919 | AdditionalOptions += option; | 924 | AdditionalOptions += option; |
920 | break; | 925 | break; |
921 | } | 926 | } |
922 | return FALSE; | 927 | found = FALSE; break; |
923 | case 'w': | 928 | case 'w': |
924 | switch ( second ) { | 929 | switch ( second ) { |
925 | case '\0': | 930 | case '\0': |
926 | WarningLevel = warningLevel_0; | 931 | WarningLevel = warningLevel_0; |
927 | break; | 932 | break; |
928 | case 'd': | 933 | case 'd': |
929 | DisableSpecificWarnings += option+3; | 934 | DisableSpecificWarnings += option+3; |
930 | break; | 935 | break; |
931 | default: | 936 | default: |
932 | AdditionalOptions += option; | 937 | AdditionalOptions += option; |
933 | } | 938 | } |
934 | break; | 939 | break; |
935 | default: | 940 | default: |
936 | return FALSE; | 941 | found = FALSE; break; |
937 | } | 942 | } |
943 | if( !found ) | ||
944 | warn_msg( WarnLogic, "Could not parse Compiler option: %s", option ); | ||
938 | return TRUE; | 945 | return TRUE; |
939 | } | 946 | } |
940 | 947 | ||
941 | // VCLinkerTool ----------------------------------------------------- | 948 | // VCLinkerTool ----------------------------------------------------- |
942 | VCLinkerTool::VCLinkerTool() | 949 | VCLinkerTool::VCLinkerTool() |
943 | :EnableCOMDATFolding( optFoldingDefault ), | 950 | :EnableCOMDATFolding( optFoldingDefault ), |
944 | GenerateDebugInformation( unset ), | 951 | GenerateDebugInformation( unset ), |
945 | GenerateMapFile( unset ), | 952 | GenerateMapFile( unset ), |
946 | HeapCommitSize( -1 ), | 953 | HeapCommitSize( -1 ), |
947 | HeapReserveSize( -1 ), | 954 | HeapReserveSize( -1 ), |
948 | IgnoreAllDefaultLibraries( unset ), | 955 | IgnoreAllDefaultLibraries( unset ), |
949 | IgnoreEmbeddedIDL( unset ), | 956 | IgnoreEmbeddedIDL( unset ), |
950 | IgnoreImportLibrary( unset ), | 957 | IgnoreImportLibrary( unset ), |
951 | LargeAddressAware( addrAwareDefault ), | 958 | LargeAddressAware( addrAwareDefault ), |
952 | LinkDLL( unset ), | 959 | LinkDLL( unset ), |
953 | LinkIncremental( linkIncrementalYes ), | 960 | LinkIncremental( linkIncrementalYes ), |
954 | LinkTimeCodeGeneration( unset ), | 961 | LinkTimeCodeGeneration( unset ), |
955 | MapExports( unset ), | 962 | MapExports( unset ), |
956 | MapLines( unset ), | 963 | MapLines( unset ), |
957 | OptimizeForWindows98( optWin98Default ), | 964 | OptimizeForWindows98( optWin98Default ), |
958 | OptimizeReferences( optReferencesDefault ), | 965 | OptimizeReferences( optReferencesDefault ), |
959 | RegisterOutput( unset ), | 966 | RegisterOutput( unset ), |
960 | ResourceOnlyDLL( unset ), | 967 | ResourceOnlyDLL( unset ), |
961 | SetChecksum( unset ), | 968 | SetChecksum( unset ), |
962 | ShowProgress( linkProgressNotSet ), | 969 | ShowProgress( linkProgressNotSet ), |
963 | StackCommitSize( -1 ), | 970 | StackCommitSize( -1 ), |
964 | StackReserveSize( -1 ), | 971 | StackReserveSize( -1 ), |
965 | SubSystem( subSystemNotSet ), | 972 | SubSystem( subSystemNotSet ), |
966 | SupportUnloadOfDelayLoadedDLL( unset ), | 973 | SupportUnloadOfDelayLoadedDLL( unset ), |
967 | SuppressStartupBanner( unset ), | 974 | SuppressStartupBanner( unset ), |
968 | SwapRunFromCD( unset ), | 975 | SwapRunFromCD( unset ), |
969 | SwapRunFromNet( unset ), | 976 | SwapRunFromNet( unset ), |
970 | TargetMachine( machineNotSet ), | 977 | TargetMachine( machineNotSet ), |
971 | TerminalServerAware( termSvrAwareDefault ), | 978 | TerminalServerAware( termSvrAwareDefault ), |
972 | TurnOffAssemblyGeneration( unset ), | 979 | TurnOffAssemblyGeneration( unset ), |
973 | TypeLibraryResourceID( 0 ) | 980 | TypeLibraryResourceID( 0 ) |
974 | { | 981 | { |
975 | } | 982 | } |
976 | 983 | ||
977 | QTextStream &operator<<( QTextStream &strm, const VCLinkerTool &tool ) | 984 | QTextStream &operator<<( QTextStream &strm, const VCLinkerTool &tool ) |
978 | { | 985 | { |
979 | strm << _begTool3; | 986 | strm << _begTool3; |
980 | strm << _VCLinkerToolName; | 987 | strm << _VCLinkerToolName; |
981 | strm << XPair( _AdditionalDependencies4, tool.AdditionalDependencies, " " ); | 988 | strm << XPair( _AdditionalDependencies4, tool.AdditionalDependencies, " " ); |
982 | strm << XPair( _AdditionalLibraryDirectories, tool.AdditionalLibraryDirectories ); | 989 | strm << XPair( _AdditionalLibraryDirectories, tool.AdditionalLibraryDirectories ); |
983 | strm << XPair( _AdditionalOptions, tool.AdditionalOptions ); | 990 | strm << XPair( _AdditionalOptions, tool.AdditionalOptions, " " ); |
984 | strm << XPair( _AddModuleNamesToAssembly, tool.AddModuleNamesToAssembly ); | 991 | strm << XPair( _AddModuleNamesToAssembly, tool.AddModuleNamesToAssembly ); |
985 | strm << SPair( _BaseAddress, tool.BaseAddress ); | 992 | strm << SPair( _BaseAddress, tool.BaseAddress ); |
986 | strm << XPair( _DelayLoadDLLs, tool.DelayLoadDLLs ); | 993 | strm << XPair( _DelayLoadDLLs, tool.DelayLoadDLLs ); |
987 | if ( tool.EnableCOMDATFolding != optFoldingDefault ) strm << EPair( _EnableCOMDATFolding, tool.EnableCOMDATFolding ); | 994 | if ( tool.EnableCOMDATFolding != optFoldingDefault ) strm << EPair( _EnableCOMDATFolding, tool.EnableCOMDATFolding ); |
988 | strm << SPair( _EntryPointSymbol, tool.EntryPointSymbol ); | 995 | strm << SPair( _EntryPointSymbol, tool.EntryPointSymbol ); |
989 | strm << XPair( _ForceSymbolReferences, tool.ForceSymbolReferences ); | 996 | strm << XPair( _ForceSymbolReferences, tool.ForceSymbolReferences ); |
990 | strm << SPair( _FunctionOrder, tool.FunctionOrder ); | 997 | strm << SPair( _FunctionOrder, tool.FunctionOrder ); |
991 | strm << TPair( _GenerateDebugInformation, tool.GenerateDebugInformation ); | 998 | strm << TPair( _GenerateDebugInformation, tool.GenerateDebugInformation ); |
992 | strm << TPair( _GenerateMapFile, tool.GenerateMapFile ); | 999 | strm << TPair( _GenerateMapFile, tool.GenerateMapFile ); |
993 | if ( tool.HeapCommitSize != -1 ) strm << LPair( _HeapCommitSize, tool.HeapCommitSize ); | 1000 | if ( tool.HeapCommitSize != -1 ) strm << LPair( _HeapCommitSize, tool.HeapCommitSize ); |
994 | if ( tool.HeapReserveSize != -1 ) strm << LPair( _HeapReserveSize, tool.HeapReserveSize ); | 1001 | if ( tool.HeapReserveSize != -1 ) strm << LPair( _HeapReserveSize, tool.HeapReserveSize ); |
995 | strm << TPair( _IgnoreAllDefaultLibraries, tool.IgnoreAllDefaultLibraries ); | 1002 | strm << TPair( _IgnoreAllDefaultLibraries, tool.IgnoreAllDefaultLibraries ); |
996 | strm << XPair( _IgnoreDefaultLibraryNames, tool.IgnoreDefaultLibraryNames ); | 1003 | strm << XPair( _IgnoreDefaultLibraryNames, tool.IgnoreDefaultLibraryNames ); |
997 | strm << TPair( _IgnoreEmbeddedIDL, tool.IgnoreEmbeddedIDL ); | 1004 | strm << TPair( _IgnoreEmbeddedIDL, tool.IgnoreEmbeddedIDL ); |
998 | strm << TPair( _IgnoreImportLibrary, tool.IgnoreImportLibrary ); | 1005 | strm << TPair( _IgnoreImportLibrary, tool.IgnoreImportLibrary ); |
999 | strm << SPair( _ImportLibrary, tool.ImportLibrary ); | 1006 | strm << SPair( _ImportLibrary, tool.ImportLibrary ); |
1000 | if ( tool.LargeAddressAware != addrAwareDefault ) strm << EPair( _LargeAddressAware, tool.LargeAddressAware ); | 1007 | if ( tool.LargeAddressAware != addrAwareDefault ) strm << EPair( _LargeAddressAware, tool.LargeAddressAware ); |
1001 | strm << TPair( _LinkDLL, tool.LinkDLL ); | 1008 | strm << TPair( _LinkDLL, tool.LinkDLL ); |
1002 | if ( tool.LinkIncremental != linkIncrementalDefault ) strm << EPair( _LinkIncremental, tool.LinkIncremental ); | 1009 | if ( tool.LinkIncremental != linkIncrementalDefault ) strm << EPair( _LinkIncremental, tool.LinkIncremental ); |
1003 | strm << TPair( _LinkTimeCodeGeneration, tool.LinkTimeCodeGeneration ); | 1010 | strm << TPair( _LinkTimeCodeGeneration, tool.LinkTimeCodeGeneration ); |
1004 | strm << SPair( _LinkToManagedResourceFile, tool.LinkToManagedResourceFile ); | 1011 | strm << SPair( _LinkToManagedResourceFile, tool.LinkToManagedResourceFile ); |
1005 | strm << TPair( _MapExports, tool.MapExports ); | 1012 | strm << TPair( _MapExports, tool.MapExports ); |
1006 | strm << SPair( _MapFileName, tool.MapFileName ); | 1013 | strm << SPair( _MapFileName, tool.MapFileName ); |
1007 | strm << TPair( _MapLines, tool.MapLines ); | 1014 | strm << TPair( _MapLines, tool.MapLines ); |
1008 | strm << SPair( _MergedIDLBaseFileName, tool.MergedIDLBaseFileName ); | 1015 | strm << SPair( _MergedIDLBaseFileName, tool.MergedIDLBaseFileName ); |
1009 | strm << SPair( _MergeSections, tool.MergeSections ); | 1016 | strm << SPair( _MergeSections, tool.MergeSections ); |
1010 | strm << SPair( _MidlCommandFile, tool.MidlCommandFile ); | 1017 | strm << SPair( _MidlCommandFile, tool.MidlCommandFile ); |
1011 | strm << SPair( _ModuleDefinitionFile, tool.ModuleDefinitionFile ); | 1018 | strm << SPair( _ModuleDefinitionFile, tool.ModuleDefinitionFile ); |
1012 | if ( tool.OptimizeForWindows98 != optWin98Default ) strm << EPair( _OptimizeForWindows98, tool.OptimizeForWindows98 ); | 1019 | if ( tool.OptimizeForWindows98 != optWin98Default ) strm << EPair( _OptimizeForWindows98, tool.OptimizeForWindows98 ); |
1013 | if ( tool.OptimizeReferences != optReferencesDefault ) strm << EPair( _OptimizeReferences, tool.OptimizeReferences ); | 1020 | if ( tool.OptimizeReferences != optReferencesDefault ) strm << EPair( _OptimizeReferences, tool.OptimizeReferences ); |
1014 | strm << SPair( _OutputFile, tool.OutputFile ); | 1021 | strm << SPair( _OutputFile, tool.OutputFile ); |
1015 | strm << SPair( _ProgramDatabaseFile, tool.ProgramDatabaseFile ); | 1022 | strm << SPair( _ProgramDatabaseFile, tool.ProgramDatabaseFile ); |
1016 | strm << TPair( _RegisterOutput, tool.RegisterOutput ); | 1023 | strm << TPair( _RegisterOutput, tool.RegisterOutput ); |
1017 | strm << TPair( _ResourceOnlyDLL, tool.ResourceOnlyDLL ); | 1024 | strm << TPair( _ResourceOnlyDLL, tool.ResourceOnlyDLL ); |
1018 | strm << TPair( _SetChecksum, tool.SetChecksum ); | 1025 | strm << TPair( _SetChecksum, tool.SetChecksum ); |
1019 | if ( tool.ShowProgress != linkProgressNotSet ) strm << EPair( _ShowProgress, tool.ShowProgress ); | 1026 | if ( tool.ShowProgress != linkProgressNotSet ) strm << EPair( _ShowProgress, tool.ShowProgress ); |
1020 | if ( tool.StackCommitSize != -1 ) strm << LPair( _StackCommitSize, tool.StackCommitSize ); | 1027 | if ( tool.StackCommitSize != -1 ) strm << LPair( _StackCommitSize, tool.StackCommitSize ); |
1021 | if ( tool.StackReserveSize != -1 ) strm << LPair( _StackReserveSize, tool.StackReserveSize ); | 1028 | if ( tool.StackReserveSize != -1 ) strm << LPair( _StackReserveSize, tool.StackReserveSize ); |
1022 | strm << SPair( _StripPrivateSymbols, tool.StripPrivateSymbols ); | 1029 | strm << SPair( _StripPrivateSymbols, tool.StripPrivateSymbols ); |
1023 | strm << EPair( _SubSystem, tool.SubSystem ); | 1030 | strm << EPair( _SubSystem, tool.SubSystem ); |
1024 | strm << TPair( _SupportUnloadOfDelayLoadedDLL, tool.SupportUnloadOfDelayLoadedDLL ); | 1031 | strm << TPair( _SupportUnloadOfDelayLoadedDLL, tool.SupportUnloadOfDelayLoadedDLL ); |
1025 | strm << TPair( _SuppressStartupBanner, tool.SuppressStartupBanner ); | 1032 | strm << TPair( _SuppressStartupBanner, tool.SuppressStartupBanner ); |
1026 | strm << TPair( _SwapRunFromCD, tool.SwapRunFromCD ); | 1033 | strm << TPair( _SwapRunFromCD, tool.SwapRunFromCD ); |
1027 | strm << TPair( _SwapRunFromNet, tool.SwapRunFromNet ); | 1034 | strm << TPair( _SwapRunFromNet, tool.SwapRunFromNet ); |
1028 | if ( tool.TargetMachine != machineNotSet ) strm << EPair( _TargetMachine, tool.TargetMachine ); | 1035 | if ( tool.TargetMachine != machineNotSet ) strm << EPair( _TargetMachine, tool.TargetMachine ); |
1029 | if ( tool.TerminalServerAware != termSvrAwareDefault ) strm << EPair( _TerminalServerAware, tool.TerminalServerAware ); | 1036 | if ( tool.TerminalServerAware != termSvrAwareDefault ) strm << EPair( _TerminalServerAware, tool.TerminalServerAware ); |
1030 | strm << TPair( _TurnOffAssemblyGeneration, tool.TurnOffAssemblyGeneration ); | 1037 | strm << TPair( _TurnOffAssemblyGeneration, tool.TurnOffAssemblyGeneration ); |
1031 | strm << SPair( _TypeLibraryFile, tool.TypeLibraryFile ); | 1038 | strm << SPair( _TypeLibraryFile, tool.TypeLibraryFile ); |
1032 | if ( tool.TypeLibraryResourceID != rcUseDefault ) strm << LPair( _TypeLibraryResourceID, tool.TypeLibraryResourceID ); | 1039 | if ( tool.TypeLibraryResourceID != rcUseDefault ) strm << LPair( _TypeLibraryResourceID, tool.TypeLibraryResourceID ); |
1033 | strm << SPair( _Version4, tool.Version ); | 1040 | strm << SPair( _Version4, tool.Version ); |
1034 | strm << "/>"; | 1041 | strm << "/>"; |
1035 | return strm; | 1042 | return strm; |
1036 | } | 1043 | } |
1037 | 1044 | ||
1038 | // Hashing routine to do fast option lookups ---- | 1045 | // Hashing routine to do fast option lookups ---- |
1039 | // Slightly rewritten to stop on ':' ',' and '\0' | 1046 | // Slightly rewritten to stop on ':' ',' and '\0' |
1040 | // Original routine in qtranslator.cpp ---------- | 1047 | // Original routine in qtranslator.cpp ---------- |
1041 | static uint elfHash( const char* name ) | 1048 | static uint elfHash( const char* name ) |
1042 | { | 1049 | { |
1043 | const uchar *k; | 1050 | const uchar *k; |
1044 | uint h = 0; | 1051 | uint h = 0; |
1045 | uint g; | 1052 | uint g; |
1046 | 1053 | ||
1047 | if ( name ) { | 1054 | if ( name ) { |
1048 | k = (const uchar *) name; | 1055 | k = (const uchar *) name; |
1049 | while ( (*k) && | 1056 | while ( (*k) && |
1050 | (*k)!= ':' && | 1057 | (*k)!= ':' && |
1051 | (*k)!=',' && | 1058 | (*k)!=',' && |
1052 | (*k)!=' ' ) { | 1059 | (*k)!=' ' ) { |
1053 | h = ( h << 4 ) + *k++; | 1060 | h = ( h << 4 ) + *k++; |
1054 | if ( (g = (h & 0xf0000000)) != 0 ) | 1061 | if ( (g = (h & 0xf0000000)) != 0 ) |
1055 | h ^= g >> 24; | 1062 | h ^= g >> 24; |
1056 | h &= ~g; | 1063 | h &= ~g; |
1057 | } | 1064 | } |
1058 | } | 1065 | } |
1059 | if ( !h ) | 1066 | if ( !h ) |
1060 | h = 1; | 1067 | h = 1; |
1061 | return h; | 1068 | return h; |
1062 | } | 1069 | } |
1070 | |||
1071 | //#define USE_DISPLAY_HASH | ||
1072 | #ifdef USE_DISPLAY_HASH | ||
1063 | static void displayHash( const char* str ) | 1073 | static void displayHash( const char* str ) |
1064 | { | 1074 | { |
1065 | printf( "case 0x%07x: // %s\n break;\n", elfHash(str), str ); | 1075 | printf( "case 0x%07x: // %s\n break;\n", elfHash(str), str ); |
1066 | } | 1076 | } |
1077 | #endif | ||
1067 | 1078 | ||
1068 | bool VCLinkerTool::parseOption( const char* option ) | 1079 | bool VCLinkerTool::parseOption( const char* option ) |
1069 | { | 1080 | { |
1070 | #if 0 | 1081 | #ifdef USE_DISPLAY_HASH |
1071 | // Main options | 1082 | // Main options |
1072 | displayHash( "/ALIGN" ); displayHash( "/ALLOWBIND" ); displayHash( "/ASSEMBLYMODULE" ); | 1083 | displayHash( "/ALIGN" ); displayHash( "/ALLOWBIND" ); displayHash( "/ASSEMBLYMODULE" ); |
1073 | displayHash( "/ASSEMBLYRESOURCE" ); displayHash( "/BASE" ); displayHash( "/DEBUG" ); | 1084 | displayHash( "/ASSEMBLYRESOURCE" ); displayHash( "/BASE" ); displayHash( "/DEBUG" ); |
1074 | displayHash( "/DEF" ); displayHash( "/DEFAULTLIB" ); displayHash( "/DELAY" ); | 1085 | displayHash( "/DEF" ); displayHash( "/DEFAULTLIB" ); displayHash( "/DELAY" ); |
1075 | displayHash( "/DELAYLOAD" ); displayHash( "/DLL" ); displayHash( "/DRIVER" ); | 1086 | displayHash( "/DELAYLOAD" ); displayHash( "/DLL" ); displayHash( "/DRIVER" ); |
1076 | displayHash( "/ENTRY" ); displayHash( "/EXETYPE" ); displayHash( "/EXPORT" ); | 1087 | displayHash( "/ENTRY" ); displayHash( "/EXETYPE" ); displayHash( "/EXPORT" ); |
1077 | displayHash( "/FIXED" ); displayHash( "/FORCE" ); displayHash( "/HEAP" ); | 1088 | displayHash( "/FIXED" ); displayHash( "/FORCE" ); displayHash( "/HEAP" ); |
1078 | displayHash( "/IDLOUT" ); displayHash( "/IGNOREIDL" ); displayHash( "/IMPLIB" ); | 1089 | displayHash( "/IDLOUT" ); displayHash( "/IGNOREIDL" ); displayHash( "/IMPLIB" ); |
1079 | displayHash( "/INCLUDE" ); displayHash( "/INCREMENTAL" ); displayHash( "/LARGEADDRESSAWARE" ); | 1090 | displayHash( "/INCLUDE" ); displayHash( "/INCREMENTAL" ); displayHash( "/LARGEADDRESSAWARE" ); |
1080 | displayHash( "/LIBPATH" ); displayHash( "/LTCG" ); displayHash( "/MACHINE" ); | 1091 | displayHash( "/LIBPATH" ); displayHash( "/LTCG" ); displayHash( "/MACHINE" ); |
1081 | displayHash( "/MAP" ); displayHash( "/MAPINFO" ); displayHash( "/MERGE" ); | 1092 | displayHash( "/MAP" ); displayHash( "/MAPINFO" ); displayHash( "/MERGE" ); |
1082 | displayHash( "/MIDL" ); displayHash( "/NOASSEMBLY" ); displayHash( "/NODEFAULTLIB" ); | 1093 | displayHash( "/MIDL" ); displayHash( "/NOASSEMBLY" ); displayHash( "/NODEFAULTLIB" ); |
1083 | displayHash( "/NOENTRY" ); displayHash( "/NOLOGO" ); displayHash( "/OPT" ); | 1094 | displayHash( "/NOENTRY" ); displayHash( "/NOLOGO" ); displayHash( "/OPT" ); |
1084 | displayHash( "/ORDER" ); displayHash( "/OUT" ); displayHash( "/PDB" ); | 1095 | displayHash( "/ORDER" ); displayHash( "/OUT" ); displayHash( "/PDB" ); |
1085 | displayHash( "/PDBSTRIPPED" ); displayHash( "/RELEASE" ); displayHash( "/SECTION" ); | 1096 | displayHash( "/PDBSTRIPPED" ); displayHash( "/RELEASE" ); displayHash( "/SECTION" ); |
1086 | displayHash( "/STACK" ); displayHash( "/STUB" ); displayHash( "/SUBSYSTEM" ); | 1097 | displayHash( "/STACK" ); displayHash( "/STUB" ); displayHash( "/SUBSYSTEM" ); |
1087 | displayHash( "/SWAPRUN" ); displayHash( "/TLBID" ); displayHash( "/TLBOUT" ); | 1098 | displayHash( "/SWAPRUN" ); displayHash( "/TLBID" ); displayHash( "/TLBOUT" ); |
1088 | displayHash( "/TSAWARE" ); displayHash( "/VERBOSE" ); displayHash( "/VERSION" ); | 1099 | displayHash( "/TSAWARE" ); displayHash( "/VERBOSE" ); displayHash( "/VERSION" ); |
1089 | displayHash( "/VXD" ); displayHash( "/WS " ); | 1100 | displayHash( "/VXD" ); displayHash( "/WS " ); |
1090 | #endif | 1101 | #endif |
1091 | #if 0 | 1102 | #ifdef USE_DISPLAY_HASH |
1092 | // Sub options | 1103 | // Sub options |
1093 | displayHash( "UNLOAD" ); displayHash( "NOBIND" ); displayHash( "no" ); displayHash( "NOSTATUS" ); displayHash( "STATUS" ); | 1104 | displayHash( "UNLOAD" ); displayHash( "NOBIND" ); displayHash( "no" ); displayHash( "NOSTATUS" ); displayHash( "STATUS" ); |
1094 | displayHash( "AM33" ); displayHash( "ARM" ); displayHash( "CEE" ); displayHash( "IA64" ); displayHash( "X86" ); displayHash( "M32R" ); | 1105 | displayHash( "AM33" ); displayHash( "ARM" ); displayHash( "CEE" ); displayHash( "IA64" ); displayHash( "X86" ); displayHash( "M32R" ); |
1095 | displayHash( "MIPS" ); displayHash( "MIPS16" ); displayHash( "MIPSFPU" ); displayHash( "MIPSFPU16" ); displayHash( "MIPSR41XX" ); displayHash( "PPC" ); | 1106 | displayHash( "MIPS" ); displayHash( "MIPS16" ); displayHash( "MIPSFPU" ); displayHash( "MIPSFPU16" ); displayHash( "MIPSR41XX" ); displayHash( "PPC" ); |
1096 | displayHash( "SH3" ); displayHash( "SH4" ); displayHash( "SH5" ); displayHash( "THUMB" ); displayHash( "TRICORE" ); displayHash( "EXPORTS" ); | 1107 | displayHash( "SH3" ); displayHash( "SH4" ); displayHash( "SH5" ); displayHash( "THUMB" ); displayHash( "TRICORE" ); displayHash( "EXPORTS" ); |
1097 | displayHash( "LINES" ); displayHash( "REF" ); displayHash( "NOREF" ); displayHash( "ICF" ); displayHash( "WIN98" ); displayHash( "NOWIN98" ); | 1108 | displayHash( "LINES" ); displayHash( "REF" ); displayHash( "NOREF" ); displayHash( "ICF" ); displayHash( "WIN98" ); displayHash( "NOWIN98" ); |
1098 | displayHash( "CONSOLE" ); displayHash( "EFI_APPLICATION" ); displayHash( "EFI_BOOT_SERVICE_DRIVER" ); displayHash( "EFI_ROM" ); displayHash( "EFI_RUNTIME_DRIVER" ); displayHash( "NATIVE" ); | 1109 | displayHash( "CONSOLE" ); displayHash( "EFI_APPLICATION" ); displayHash( "EFI_BOOT_SERVICE_DRIVER" ); displayHash( "EFI_ROM" ); displayHash( "EFI_RUNTIME_DRIVER" ); displayHash( "NATIVE" ); |
1099 | displayHash( "POSIX" ); displayHash( "WINDOWS" ); displayHash( "WINDOWSCE" ); displayHash( "NET" ); displayHash( "CD" ); displayHash( "NO" ); | 1110 | displayHash( "POSIX" ); displayHash( "WINDOWS" ); displayHash( "WINDOWSCE" ); displayHash( "NET" ); displayHash( "CD" ); displayHash( "NO" ); |
1100 | #endif | 1111 | #endif |
1101 | 1112 | bool found = TRUE; | |
1102 | switch ( elfHash(option) ) { | 1113 | switch ( elfHash(option) ) { |
1103 | case 0x3360dbe: // /ALIGN[:number] | 1114 | case 0x3360dbe: // /ALIGN[:number] |
1104 | case 0x1485c34: // /ALLOWBIND[:NO] | 1115 | case 0x1485c34: // /ALLOWBIND[:NO] |
1105 | case 0x6b21972: // /DEFAULTLIB:library | 1116 | case 0x6b21972: // /DEFAULTLIB:library |
1106 | case 0x396ea92: // /DRIVER[:UPONLY | :WDM] | 1117 | case 0x396ea92: // /DRIVER[:UPONLY | :WDM] |
1107 | case 0xaca9d75: // /EXETYPE[:DYNAMIC | :DEV386] | 1118 | case 0xaca9d75: // /EXETYPE[:DYNAMIC | :DEV386] |
1108 | case 0x3ad5444: // /EXPORT:entryname[,@ordinal[,NONAME]][,DATA] | 1119 | case 0x3ad5444: // /EXPORT:entryname[,@ordinal[,NONAME]][,DATA] |
1109 | case 0x33aec94: // /FIXED[:NO] | 1120 | case 0x33aec94: // /FIXED[:NO] |
1110 | case 0x33b4675: // /FORCE:[MULTIPLE|UNRESOLVED] | 1121 | case 0x33b4675: // /FORCE:[MULTIPLE|UNRESOLVED] |
1111 | case 0x7988f7e: // /SECTION:name,[E][R][W][S][D][K][L][P][X][,ALIGN=#] | 1122 | case 0x7988f7e: // /SECTION:name,[E][R][W][S][D][K][L][P][X][,ALIGN=#] |
1112 | case 0x0348992: // /STUB:filename | 1123 | case 0x0348992: // /STUB:filename |
1113 | case 0x0034bc4: // /VXD | 1124 | case 0x0034bc4: // /VXD |
1114 | case 0x0034c50: // /WS | 1125 | case 0x0034c50: // /WS |
1115 | AdditionalOptions += option; | 1126 | AdditionalOptions += option; |
1116 | break; | 1127 | break; |
1117 | case 0x679c075: // /ASSEMBLYMODULE:filename | 1128 | case 0x679c075: // /ASSEMBLYMODULE:filename |
1118 | AddModuleNamesToAssembly += option+15; | 1129 | AddModuleNamesToAssembly += option+15; |
1119 | break; | 1130 | break; |
1120 | case 0x062d065: // /ASSEMBLYRESOURCE:filename | 1131 | case 0x062d065: // /ASSEMBLYRESOURCE:filename |
1121 | LinkToManagedResourceFile = option+18; | 1132 | LinkToManagedResourceFile = option+18; |
1122 | break; | 1133 | break; |
1123 | case 0x0336675: // /BASE:{address | @filename,key} | 1134 | case 0x0336675: // /BASE:{address | @filename,key} |
1124 | // Do we need to do a manual lookup when '@filename,key'? | 1135 | // Do we need to do a manual lookup when '@filename,key'? |
1125 | // Seems BaseAddress only can contain the location... | 1136 | // Seems BaseAddress only can contain the location... |
1126 | // We don't use it in Qt, so keep it simple for now | 1137 | // We don't use it in Qt, so keep it simple for now |
1127 | BaseAddress = option+6; | 1138 | BaseAddress = option+6; |
1128 | break; | 1139 | break; |
1129 | case 0x3389797: // /DEBUG | 1140 | case 0x3389797: // /DEBUG |
1130 | GenerateDebugInformation = _True; | 1141 | GenerateDebugInformation = _True; |
1131 | break; | 1142 | break; |
1132 | case 0x0033896: // /DEF:filename | 1143 | case 0x0033896: // /DEF:filename |
1133 | ModuleDefinitionFile = option+5; | 1144 | ModuleDefinitionFile = option+5; |
1134 | break; | 1145 | break; |
1135 | case 0x338a069: // /DELAY:{UNLOAD | NOBIND} | 1146 | case 0x338a069: // /DELAY:{UNLOAD | NOBIND} |
1136 | // MS documentation does not specify what to do with | 1147 | // MS documentation does not specify what to do with |
1137 | // this option, so we'll put it in AdditionalOptions | 1148 | // this option, so we'll put it in AdditionalOptions |
1138 | AdditionalOptions += option; | 1149 | AdditionalOptions += option; |
1139 | break; | 1150 | break; |
1140 | case 0x06f4bf4: // /DELAYLOAD:dllname | 1151 | case 0x06f4bf4: // /DELAYLOAD:dllname |
1141 | DelayLoadDLLs += option+11; | 1152 | DelayLoadDLLs += option+11; |
1142 | break; | 1153 | break; |
1143 | // case 0x003390c: // /DLL | 1154 | // case 0x003390c: // /DLL |
1144 | // This option is not used for vcproj files | 1155 | // This option is not used for vcproj files |
1145 | //break; | 1156 | //break; |
1146 | case 0x33a3979: // /ENTRY:function | 1157 | case 0x33a3979: // /ENTRY:function |
1147 | EntryPointSymbol = option+7; | 1158 | EntryPointSymbol = option+7; |
1148 | break; | 1159 | break; |
1149 | case 0x033c960: // /HEAP:reserve[,commit] | 1160 | case 0x033c960: // /HEAP:reserve[,commit] |
1150 | { | 1161 | { |
1151 | QStringList both = QStringList::split( ",", option+6 ); | 1162 | QStringList both = QStringList::split( ",", option+6 ); |
1152 | HeapReserveSize = both[0].toLong(); | 1163 | HeapReserveSize = both[0].toLong(); |
1153 | if ( both.count() == 2 ) | 1164 | if ( both.count() == 2 ) |
1154 | HeapCommitSize = both[1].toLong(); | 1165 | HeapCommitSize = both[1].toLong(); |
1155 | } | 1166 | } |
1156 | break; | 1167 | break; |
1157 | case 0x3d91494: // /IDLOUT:[path\]filename | 1168 | case 0x3d91494: // /IDLOUT:[path\]filename |
1158 | MergedIDLBaseFileName = option+8; | 1169 | MergedIDLBaseFileName = option+8; |
1159 | break; | 1170 | break; |
1160 | case 0x345a04c: // /IGNOREIDL | 1171 | case 0x345a04c: // /IGNOREIDL |
1161 | IgnoreEmbeddedIDL = _True; | 1172 | IgnoreEmbeddedIDL = _True; |
1162 | break; | 1173 | break; |
1163 | case 0x3e250e2: // /IMPLIB:filename | 1174 | case 0x3e250e2: // /IMPLIB:filename |
1164 | ImportLibrary = option+8; | 1175 | ImportLibrary = option+8; |
1165 | break; | 1176 | break; |
1166 | case 0xe281ab5: // /INCLUDE:symbol | 1177 | case 0xe281ab5: // /INCLUDE:symbol |
1167 | ForceSymbolReferences += option+9; | 1178 | ForceSymbolReferences += option+9; |
1168 | break; | 1179 | break; |
1169 | case 0xb28103c: // /INCREMENTAL[:no] | 1180 | case 0xb28103c: // /INCREMENTAL[:no] |
1170 | if ( *(option+12) == ':' && | 1181 | if ( *(option+12) == ':' && |
1171 | *(option+13) == 'n' ) | 1182 | *(option+13) == 'n' ) |
1172 | LinkIncremental = linkIncrementalNo; | 1183 | LinkIncremental = linkIncrementalNo; |
1173 | else | 1184 | else |
1174 | LinkIncremental = linkIncrementalYes; | 1185 | LinkIncremental = linkIncrementalYes; |
1175 | break; | 1186 | break; |
1176 | case 0x26e4675: // /LARGEADDRESSAWARE[:no] | 1187 | case 0x26e4675: // /LARGEADDRESSAWARE[:no] |
1177 | if ( *(option+18) == ':' && | 1188 | if ( *(option+18) == ':' && |
1178 | *(option+19) == 'n' ) | 1189 | *(option+19) == 'n' ) |
1179 | LargeAddressAware = addrAwareNoLarge; | 1190 | LargeAddressAware = addrAwareNoLarge; |
1180 | else | 1191 | else |
1181 | LargeAddressAware = addrAwareLarge; | 1192 | LargeAddressAware = addrAwareLarge; |
1182 | break; | 1193 | break; |
1183 | case 0x0d745c8: // /LIBPATH:dir | 1194 | case 0x0d745c8: // /LIBPATH:dir |
1184 | AdditionalLibraryDirectories += option+9; | 1195 | AdditionalLibraryDirectories += option+9; |
1185 | break; | 1196 | break; |
1186 | case 0x0341877: // /LTCG[:NOSTATUS|:STATUS] | 1197 | case 0x0341877: // /LTCG[:NOSTATUS|:STATUS] |
1187 | config->WholeProgramOptimization = _True; | 1198 | config->WholeProgramOptimization = _True; |
1188 | LinkTimeCodeGeneration = _True; | 1199 | LinkTimeCodeGeneration = _True; |
1189 | if ( *(option+5) == ':' && | 1200 | if ( *(option+5) == ':' && |
1190 | *(option+6) == 'S' ) | 1201 | *(option+6) == 'S' ) |
1191 | ShowProgress = linkProgressAll; | 1202 | ShowProgress = linkProgressAll; |
1192 | break; | 1203 | break; |
1193 | case 0x157cf65: // /MACHINE:{AM33|ARM|CEE|IA64|X86|M32R|MIPS|MIPS16|MIPSFPU|MIPSFPU16|MIPSR41XX|PPC|SH3|SH4|SH5|THUMB|TRICORE} | 1204 | case 0x157cf65: // /MACHINE:{AM33|ARM|CEE|IA64|X86|M32R|MIPS|MIPS16|MIPSFPU|MIPSFPU16|MIPSR41XX|PPC|SH3|SH4|SH5|THUMB|TRICORE} |
1194 | switch ( elfHash(option+9) ) { | 1205 | switch ( elfHash(option+9) ) { |
1195 | // Very limited documentation on all options but X86, | 1206 | // Very limited documentation on all options but X86, |
1196 | // so we put the others in AdditionalOptions... | 1207 | // so we put the others in AdditionalOptions... |
1197 | case 0x0046063: // AM33 | 1208 | case 0x0046063: // AM33 |
1198 | case 0x000466d: // ARM | 1209 | case 0x000466d: // ARM |
1199 | case 0x0004795: // CEE | 1210 | case 0x0004795: // CEE |
1200 | case 0x004d494: // IA64 | 1211 | case 0x004d494: // IA64 |
1201 | case 0x0050672: // M32R | 1212 | case 0x0050672: // M32R |
1202 | case 0x0051e53: // MIPS | 1213 | case 0x0051e53: // MIPS |
1203 | case 0x51e5646: // MIPS16 | 1214 | case 0x51e5646: // MIPS16 |
1204 | case 0x1e57b05: // MIPSFPU | 1215 | case 0x1e57b05: // MIPSFPU |
1205 | case 0x57b09a6: // MIPSFPU16 | 1216 | case 0x57b09a6: // MIPSFPU16 |
1206 | case 0x5852738: // MIPSR41XX | 1217 | case 0x5852738: // MIPSR41XX |
1207 | case 0x0005543: // PPC | 1218 | case 0x0005543: // PPC |
1208 | case 0x00057b3: // SH3 | 1219 | case 0x00057b3: // SH3 |
1209 | case 0x00057b4: // SH4 | 1220 | case 0x00057b4: // SH4 |
1210 | case 0x00057b5: // SH5 | 1221 | case 0x00057b5: // SH5 |
1211 | case 0x058da12: // THUMB | 1222 | case 0x058da12: // THUMB |
1212 | case 0x96d8435: // TRICORE | 1223 | case 0x96d8435: // TRICORE |
1213 | AdditionalOptions += option; | 1224 | AdditionalOptions += option; |
1214 | break; | 1225 | break; |
1215 | case 0x0005bb6: // X86 | 1226 | case 0x0005bb6: // X86 |
1216 | TargetMachine = machineX86; | 1227 | TargetMachine = machineX86; |
1217 | break; | 1228 | break; |
1218 | default: | 1229 | default: |
1219 | return FALSE; | 1230 | found = FALSE; |
1220 | } | 1231 | } |
1221 | break; | 1232 | break; |
1222 | case 0x0034160: // /MAP[:filename] | 1233 | case 0x0034160: // /MAP[:filename] |
1223 | GenerateMapFile = _True; | 1234 | GenerateMapFile = _True; |
1224 | MapFileName = option+5; | 1235 | MapFileName = option+5; |
1225 | break; | 1236 | break; |
1226 | case 0x164e1ef: // /MAPINFO:{EXPORTS|LINES} | 1237 | case 0x164e1ef: // /MAPINFO:{EXPORTS|LINES} |
1227 | if ( *(option+9) == 'E' ) | 1238 | if ( *(option+9) == 'E' ) |
1228 | MapExports = _True; | 1239 | MapExports = _True; |
1229 | else if ( *(option+9) == 'L' ) | 1240 | else if ( *(option+9) == 'L' ) |
1230 | MapLines = _True; | 1241 | MapLines = _True; |
1231 | break; | 1242 | break; |
1232 | case 0x341a6b5: // /MERGE:from=to | 1243 | case 0x341a6b5: // /MERGE:from=to |
1233 | MergeSections = option+7; | 1244 | MergeSections = option+7; |
1234 | break; | 1245 | break; |
1235 | case 0x0341d8c: // /MIDL:@file | 1246 | case 0x0341d8c: // /MIDL:@file |
1236 | MidlCommandFile = option+7; | 1247 | MidlCommandFile = option+7; |
1237 | break; | 1248 | break; |
1238 | case 0x84e2679: // /NOASSEMBLY | 1249 | case 0x84e2679: // /NOASSEMBLY |
1239 | TurnOffAssemblyGeneration = _True; | 1250 | TurnOffAssemblyGeneration = _True; |
1240 | break; | 1251 | break; |
1241 | case 0x2b21942: // /NODEFAULTLIB[:library] | 1252 | case 0x2b21942: // /NODEFAULTLIB[:library] |
1242 | if ( *(option+13) == '\0' ) | 1253 | if ( *(option+13) == '\0' ) |
1243 | IgnoreAllDefaultLibraries = _True; | 1254 | IgnoreAllDefaultLibraries = _True; |
1244 | else | 1255 | else |
1245 | IgnoreDefaultLibraryNames += option+14; | 1256 | IgnoreDefaultLibraryNames += option+14; |
1246 | break; | 1257 | break; |
1247 | case 0x33a3a39: // /NOENTRY | 1258 | case 0x33a3a39: // /NOENTRY |
1248 | ResourceOnlyDLL = _True; | 1259 | ResourceOnlyDLL = _True; |
1249 | break; | 1260 | break; |
1250 | case 0x434138f: // /NOLOGO | 1261 | case 0x434138f: // /NOLOGO |
1251 | SuppressStartupBanner = _True; | 1262 | SuppressStartupBanner = _True; |
1252 | break; | 1263 | break; |
1253 | case 0x0034454: // /OPT:{REF | NOREF | ICF[=iterations] | NOICF | WIN98 | NOWIN98} | 1264 | case 0x0034454: // /OPT:{REF | NOREF | ICF[=iterations] | NOICF | WIN98 | NOWIN98} |
1254 | { | 1265 | { |
1255 | char third = *(option+7); | 1266 | char third = *(option+7); |
1256 | switch ( third ) { | 1267 | switch ( third ) { |
1257 | case 'F': // REF | 1268 | case 'F': // REF |
1258 | if ( *(option+5) == 'R' ) { | 1269 | if ( *(option+5) == 'R' ) { |
1259 | OptimizeReferences = optReferences; | 1270 | OptimizeReferences = optReferences; |
1260 | } else { // ICF[=iterations] | 1271 | } else { // ICF[=iterations] |
1261 | EnableCOMDATFolding = optFolding; | 1272 | EnableCOMDATFolding = optFolding; |
1262 | // [=iterations] case is not documented | 1273 | // [=iterations] case is not documented |
1263 | } | 1274 | } |
1264 | break; | 1275 | break; |
1265 | case 'R': // NOREF | 1276 | case 'R': // NOREF |
1266 | OptimizeReferences = optNoReferences; | 1277 | OptimizeReferences = optNoReferences; |
1267 | break; | 1278 | break; |
1268 | case 'I': // NOICF | 1279 | case 'I': // NOICF |
1269 | EnableCOMDATFolding = optNoFolding; | 1280 | EnableCOMDATFolding = optNoFolding; |
1270 | break; | 1281 | break; |
1271 | case 'N': // WIN98 | 1282 | case 'N': // WIN98 |
1272 | OptimizeForWindows98 = optWin98Yes; | 1283 | OptimizeForWindows98 = optWin98Yes; |
1273 | break; | 1284 | break; |
1274 | case 'W': // NOWIN98 | 1285 | case 'W': // NOWIN98 |
1275 | OptimizeForWindows98 = optWin98No; | 1286 | OptimizeForWindows98 = optWin98No; |
1276 | break; | 1287 | break; |
1277 | default: | 1288 | default: |
1278 | return FALSE; | 1289 | found = FALSE; |
1279 | } | 1290 | } |
1280 | } | 1291 | } |
1281 | break; | 1292 | break; |
1282 | case 0x34468a2: // /ORDER:@filename | 1293 | case 0x34468a2: // /ORDER:@filename |
1283 | FunctionOrder = option+8; | 1294 | FunctionOrder = option+8; |
1284 | break; | 1295 | break; |
1285 | case 0x00344a4: // /OUT:filename | 1296 | case 0x00344a4: // /OUT:filename |
1286 | OutputFile = option+5; | 1297 | OutputFile = option+5; |
1287 | break; | 1298 | break; |
1288 | case 0x0034482: // /PDB:filename | 1299 | case 0x0034482: // /PDB:filename |
1289 | ProgramDatabaseFile = option+5; | 1300 | ProgramDatabaseFile = option+5; |
1290 | break; | 1301 | break; |
1291 | case 0xa2ad314: // /PDBSTRIPPED:pdb_file_name | 1302 | case 0xa2ad314: // /PDBSTRIPPED:pdb_file_name |
1292 | StripPrivateSymbols = option+13; | 1303 | StripPrivateSymbols = option+13; |
1293 | break; | 1304 | break; |
1294 | case 0x6a09535: // /RELEASE | 1305 | case 0x6a09535: // /RELEASE |
1295 | SetChecksum = _True; | 1306 | SetChecksum = _True; |
1296 | break; | 1307 | break; |
1297 | case 0x348857b: // /STACK:reserve[,commit] | 1308 | case 0x348857b: // /STACK:reserve[,commit] |
1298 | { | 1309 | { |
1299 | QStringList both = QStringList::split( ",", option+7 ); | 1310 | QStringList both = QStringList::split( ",", option+7 ); |
1300 | StackReserveSize = both[0].toLong(); | 1311 | StackReserveSize = both[0].toLong(); |
1301 | if ( both.count() == 2 ) | 1312 | if ( both.count() == 2 ) |
1302 | StackCommitSize = both[1].toLong(); | 1313 | StackCommitSize = both[1].toLong(); |
1303 | } | 1314 | } |
1304 | break; | 1315 | break; |
1305 | case 0x78dc00d: // /SUBSYSTEM:{CONSOLE|EFI_APPLICATION|EFI_BOOT_SERVICE_DRIVER|EFI_ROM|EFI_RUNTIME_DRIVER|NATIVE|POSIX|WINDOWS|WINDOWSCE}[,major[.minor]] | 1316 | case 0x78dc00d: // /SUBSYSTEM:{CONSOLE|EFI_APPLICATION|EFI_BOOT_SERVICE_DRIVER|EFI_ROM|EFI_RUNTIME_DRIVER|NATIVE|POSIX|WINDOWS|WINDOWSCE}[,major[.minor]] |
1306 | { | 1317 | { |
1307 | // Split up in subsystem, and version number | 1318 | // Split up in subsystem, and version number |
1308 | QStringList both = QStringList::split( ",", option+11 ); | 1319 | QStringList both = QStringList::split( ",", option+11 ); |
1309 | switch ( elfHash(both[0].latin1()) ) { | 1320 | switch ( elfHash(both[0].latin1()) ) { |
1310 | case 0x8438445: // CONSOLE | 1321 | case 0x8438445: // CONSOLE |
1311 | SubSystem = subSystemConsole; | 1322 | SubSystem = subSystemConsole; |
1312 | break; | 1323 | break; |
1313 | case 0xbe29493: // WINDOWS | 1324 | case 0xbe29493: // WINDOWS |
1314 | SubSystem = subSystemWindows; | 1325 | SubSystem = subSystemWindows; |
1315 | break; | 1326 | break; |
1316 | // The following are undocumented, so add them to AdditionalOptions | 1327 | // The following are undocumented, so add them to AdditionalOptions |
1317 | case 0x240949e: // EFI_APPLICATION | 1328 | case 0x240949e: // EFI_APPLICATION |
1318 | case 0xe617652: // EFI_BOOT_SERVICE_DRIVER | 1329 | case 0xe617652: // EFI_BOOT_SERVICE_DRIVER |
1319 | case 0x9af477d: // EFI_ROM | 1330 | case 0x9af477d: // EFI_ROM |
1320 | case 0xd34df42: // EFI_RUNTIME_DRIVER | 1331 | case 0xd34df42: // EFI_RUNTIME_DRIVER |
1321 | case 0x5268ea5: // NATIVE | 1332 | case 0x5268ea5: // NATIVE |
1322 | case 0x05547e8: // POSIX | 1333 | case 0x05547e8: // POSIX |
1323 | case 0x2949c95: // WINDOWSCE | 1334 | case 0x2949c95: // WINDOWSCE |
1324 | AdditionalOptions += option; | 1335 | AdditionalOptions += option; |
1325 | break; | 1336 | break; |
1326 | default: | 1337 | default: |
1327 | return FALSE; | 1338 | found = FALSE; |
1328 | } | 1339 | } |
1329 | } | 1340 | } |
1330 | break; | 1341 | break; |
1331 | case 0x8b654de: // /SWAPRUN:{NET | CD} | 1342 | case 0x8b654de: // /SWAPRUN:{NET | CD} |
1332 | if ( *(option+9) == 'N' ) | 1343 | if ( *(option+9) == 'N' ) |
1333 | SwapRunFromNet = _True; | 1344 | SwapRunFromNet = _True; |
1334 | else if ( *(option+9) == 'C' ) | 1345 | else if ( *(option+9) == 'C' ) |
1335 | SwapRunFromCD = _True; | 1346 | SwapRunFromCD = _True; |
1336 | else | 1347 | else |
1337 | return FALSE; | 1348 | found = FALSE; |
1338 | break; | 1349 | break; |
1339 | case 0x34906d4: // /TLBID:id | 1350 | case 0x34906d4: // /TLBID:id |
1340 | TypeLibraryResourceID = QString( option+7 ).toLong(); | 1351 | TypeLibraryResourceID = QString( option+7 ).toLong(); |
1341 | break; | 1352 | break; |
1342 | case 0x4907494: // /TLBOUT:[path\]filename | 1353 | case 0x4907494: // /TLBOUT:[path\]filename |
1343 | TypeLibraryFile = option+8; | 1354 | TypeLibraryFile = option+8; |
1344 | break; | 1355 | break; |
1345 | case 0x976b525: // /TSAWARE[:NO] | 1356 | case 0x976b525: // /TSAWARE[:NO] |
1346 | if ( *(option+8) == ':' ) | 1357 | if ( *(option+8) == ':' ) |
1347 | TerminalServerAware = termSvrAwareNo; | 1358 | TerminalServerAware = termSvrAwareNo; |
1348 | else | 1359 | else |
1349 | TerminalServerAware = termSvrAwareYes; | 1360 | TerminalServerAware = termSvrAwareYes; |
1350 | break; | 1361 | break; |
1351 | case 0xaa67735: // /VERBOSE[:lib] | 1362 | case 0xaa67735: // /VERBOSE[:lib] |
1352 | if ( *(option+9) == ':' ) { | 1363 | if ( *(option+9) == ':' ) { |
1353 | ShowProgress = linkProgressLibs; | 1364 | ShowProgress = linkProgressLibs; |
1354 | AdditionalOptions += option; | 1365 | AdditionalOptions += option; |
1355 | } else { | 1366 | } else { |
1356 | ShowProgress = linkProgressAll; | 1367 | ShowProgress = linkProgressAll; |
1357 | } | 1368 | } |
1358 | break; | 1369 | break; |
1359 | case 0xaa77f7e: // /VERSION:major[.minor] | 1370 | case 0xaa77f7e: // /VERSION:major[.minor] |
1360 | Version = option+9; | 1371 | Version = option+9; |
1361 | break; | 1372 | break; |
1362 | default: | 1373 | default: |
1363 | return FALSE; | 1374 | found = FALSE; |
1364 | } | 1375 | } |
1365 | return TRUE; | 1376 | if( !found ) |
1377 | warn_msg( WarnLogic, "Could not parse Linker options: %s", option ); | ||
1378 | return found; | ||
1366 | } | 1379 | } |
1367 | 1380 | ||
1368 | // VCMIDLTool ------------------------------------------------------- | 1381 | // VCMIDLTool ------------------------------------------------------- |
1369 | VCMIDLTool::VCMIDLTool() | 1382 | VCMIDLTool::VCMIDLTool() |
1370 | :DefaultCharType( midlCharUnsigned ), | 1383 | :DefaultCharType( midlCharUnsigned ), |
1371 | EnableErrorChecks( midlDisableAll ), | 1384 | EnableErrorChecks( midlDisableAll ), |
1372 | ErrorCheckAllocations( unset ), | 1385 | ErrorCheckAllocations( unset ), |
1373 | ErrorCheckBounds( unset ), | 1386 | ErrorCheckBounds( unset ), |
1374 | ErrorCheckEnumRange( unset ), | 1387 | ErrorCheckEnumRange( unset ), |
1375 | ErrorCheckRefPointers( unset ), | 1388 | ErrorCheckRefPointers( unset ), |
1376 | ErrorCheckStubData( unset ), | 1389 | ErrorCheckStubData( unset ), |
1377 | GenerateStublessProxies( unset ), | 1390 | GenerateStublessProxies( unset ), |
1378 | GenerateTypeLibrary( unset ), | 1391 | GenerateTypeLibrary( unset ), |
1379 | IgnoreStandardIncludePath( unset ), | 1392 | IgnoreStandardIncludePath( unset ), |
1380 | MkTypLibCompatible( unset ), | 1393 | MkTypLibCompatible( unset ), |
1381 | StructMemberAlignment( midlAlignNotSet ), | 1394 | StructMemberAlignment( midlAlignNotSet ), |
1382 | SuppressStartupBanner( unset ), | 1395 | SuppressStartupBanner( unset ), |
1383 | TargetEnvironment( midlTargetNotSet ), | 1396 | TargetEnvironment( midlTargetNotSet ), |
1384 | ValidateParameters( unset ), | 1397 | ValidateParameters( unset ), |
1385 | WarnAsError( unset ), | 1398 | WarnAsError( unset ), |
1386 | WarningLevel( midlWarningLevel_0 ) | 1399 | WarningLevel( midlWarningLevel_0 ) |
1387 | { | 1400 | { |
1388 | } | 1401 | } |
1389 | 1402 | ||
1390 | QTextStream &operator<<( QTextStream &strm, const VCMIDLTool &tool ) | 1403 | QTextStream &operator<<( QTextStream &strm, const VCMIDLTool &tool ) |
1391 | { | 1404 | { |
1392 | strm << _begTool3; | 1405 | strm << _begTool3; |
1393 | strm << _VCMIDLToolName; | 1406 | strm << _VCMIDLToolName; |
1394 | strm << XPair( _AdditionalIncludeDirectories, tool.AdditionalIncludeDirectories ); | 1407 | strm << XPair( _AdditionalIncludeDirectories, tool.AdditionalIncludeDirectories ); |
1395 | strm << XPair( _AdditionalOptions, tool.AdditionalOptions ); | 1408 | strm << XPair( _AdditionalOptions, tool.AdditionalOptions, " " ); |
1396 | strm << XPair( _CPreprocessOptions, tool.CPreprocessOptions ); | 1409 | strm << XPair( _CPreprocessOptions, tool.CPreprocessOptions ); |
1397 | strm << EPair( _DefaultCharType, tool.DefaultCharType ); | 1410 | strm << EPair( _DefaultCharType, tool.DefaultCharType ); |
1398 | strm << SPair( _DLLDataFileName, tool.DLLDataFileName ); | 1411 | strm << SPair( _DLLDataFileName, tool.DLLDataFileName ); |
1399 | strm << EPair( _EnableErrorChecks, tool.EnableErrorChecks ); | 1412 | strm << EPair( _EnableErrorChecks, tool.EnableErrorChecks ); |
1400 | strm << TPair( _ErrorCheckAllocations, tool.ErrorCheckAllocations ); | 1413 | strm << TPair( _ErrorCheckAllocations, tool.ErrorCheckAllocations ); |
1401 | strm << TPair( _ErrorCheckBounds, tool.ErrorCheckBounds ); | 1414 | strm << TPair( _ErrorCheckBounds, tool.ErrorCheckBounds ); |
1402 | strm << TPair( _ErrorCheckEnumRange, tool.ErrorCheckEnumRange ); | 1415 | strm << TPair( _ErrorCheckEnumRange, tool.ErrorCheckEnumRange ); |
1403 | strm << TPair( _ErrorCheckRefPointers, tool.ErrorCheckRefPointers ); | 1416 | strm << TPair( _ErrorCheckRefPointers, tool.ErrorCheckRefPointers ); |
1404 | strm << TPair( _ErrorCheckStubData, tool.ErrorCheckStubData ); | 1417 | strm << TPair( _ErrorCheckStubData, tool.ErrorCheckStubData ); |
1405 | strm << XPair( _FullIncludePath, tool.FullIncludePath ); | 1418 | strm << XPair( _FullIncludePath, tool.FullIncludePath ); |
1406 | strm << TPair( _GenerateStublessProxies, tool.GenerateStublessProxies ); | 1419 | strm << TPair( _GenerateStublessProxies, tool.GenerateStublessProxies ); |
1407 | strm << TPair( _GenerateTypeLibrary, tool.GenerateTypeLibrary ); | 1420 | strm << TPair( _GenerateTypeLibrary, tool.GenerateTypeLibrary ); |
1408 | strm << SPair( _HeaderFileName, tool.HeaderFileName ); | 1421 | strm << SPair( _HeaderFileName, tool.HeaderFileName ); |
1409 | strm << TPair( _IgnoreStandardIncludePath, tool.IgnoreStandardIncludePath ); | 1422 | strm << TPair( _IgnoreStandardIncludePath, tool.IgnoreStandardIncludePath ); |
1410 | strm << SPair( _InterfaceIdentifierFileName, tool.InterfaceIdentifierFileName ); | 1423 | strm << SPair( _InterfaceIdentifierFileName, tool.InterfaceIdentifierFileName ); |
1411 | strm << TPair( _MkTypLibCompatible, tool.MkTypLibCompatible ); | 1424 | strm << TPair( _MkTypLibCompatible, tool.MkTypLibCompatible ); |
1412 | strm << SPair( _OutputDirectory4, tool.OutputDirectory ); | 1425 | strm << SPair( _OutputDirectory4, tool.OutputDirectory ); |
1413 | strm << XPair( _PreprocessorDefinitions, tool.PreprocessorDefinitions ); | 1426 | strm << XPair( _PreprocessorDefinitions, tool.PreprocessorDefinitions ); |
1414 | strm << SPair( _ProxyFileName, tool.ProxyFileName ); | 1427 | strm << SPair( _ProxyFileName, tool.ProxyFileName ); |
1415 | strm << SPair( _RedirectOutputAndErrors, tool.RedirectOutputAndErrors ); | 1428 | strm << SPair( _RedirectOutputAndErrors, tool.RedirectOutputAndErrors ); |
1416 | if ( tool.StructMemberAlignment != midlAlignNotSet) strm << EPair( _StructMemberAlignment, tool.StructMemberAlignment ); | 1429 | if ( tool.StructMemberAlignment != midlAlignNotSet) strm << EPair( _StructMemberAlignment, tool.StructMemberAlignment ); |
1417 | strm << TPair( _SuppressStartupBanner, tool.SuppressStartupBanner ); | 1430 | strm << TPair( _SuppressStartupBanner, tool.SuppressStartupBanner ); |
1418 | if ( tool.TargetEnvironment != midlTargetNotSet ) strm << EPair( _TargetEnvironment, tool.TargetEnvironment ); | 1431 | if ( tool.TargetEnvironment != midlTargetNotSet ) strm << EPair( _TargetEnvironment, tool.TargetEnvironment ); |
1419 | strm << SPair( _TypeLibraryName, tool.TypeLibraryName ); | 1432 | strm << SPair( _TypeLibraryName, tool.TypeLibraryName ); |
1420 | strm << XPair( _UndefinePreprocessorDefinitions, tool.UndefinePreprocessorDefinitions ); | 1433 | strm << XPair( _UndefinePreprocessorDefinitions, tool.UndefinePreprocessorDefinitions ); |
1421 | strm << TPair( _ValidateParameters, tool.ValidateParameters ); | 1434 | strm << TPair( _ValidateParameters, tool.ValidateParameters ); |
1422 | strm << TPair( _WarnAsError, tool.WarnAsError ); | 1435 | strm << TPair( _WarnAsError, tool.WarnAsError ); |
1423 | strm << EPair( _WarningLevel, tool.WarningLevel ); | 1436 | strm << EPair( _WarningLevel, tool.WarningLevel ); |
1424 | strm << "/>"; | 1437 | strm << "/>"; |
1425 | return strm; | 1438 | return strm; |
1426 | } | 1439 | } |
1427 | 1440 | ||
1428 | bool VCMIDLTool::parseOption( const char* option ) | 1441 | bool VCMIDLTool::parseOption( const char* option ) |
1429 | { | 1442 | { |
1430 | #if 0 | 1443 | #ifdef USE_DISPLAY_HASH |
1431 | displayHash( "/D name[=def]" ); displayHash( "/I directory-list" ); displayHash( "/Oi" ); | 1444 | displayHash( "/D name[=def]" ); displayHash( "/I directory-list" ); displayHash( "/Oi" ); |
1432 | displayHash( "/Oic" ); displayHash( "/Oicf" ); displayHash( "/Oif" ); displayHash( "/Os" ); | 1445 | displayHash( "/Oic" ); displayHash( "/Oicf" ); displayHash( "/Oif" ); displayHash( "/Os" ); |
1433 | displayHash( "/U name" ); displayHash( "/WX" ); displayHash( "/W{0|1|2|3|4}" ); | 1446 | displayHash( "/U name" ); displayHash( "/WX" ); displayHash( "/W{0|1|2|3|4}" ); |
1434 | displayHash( "/Zp {N}" ); displayHash( "/Zs" ); displayHash( "/acf filename" ); | 1447 | displayHash( "/Zp {N}" ); displayHash( "/Zs" ); displayHash( "/acf filename" ); |
1435 | displayHash( "/align {N}" ); displayHash( "/app_config" ); displayHash( "/c_ext" ); | 1448 | displayHash( "/align {N}" ); displayHash( "/app_config" ); displayHash( "/c_ext" ); |
1436 | displayHash( "/char ascii7" ); displayHash( "/char signed" ); displayHash( "/char unsigned" ); | 1449 | displayHash( "/char ascii7" ); displayHash( "/char signed" ); displayHash( "/char unsigned" ); |
1437 | displayHash( "/client none" ); displayHash( "/client stub" ); displayHash( "/confirm" ); | 1450 | displayHash( "/client none" ); displayHash( "/client stub" ); displayHash( "/confirm" ); |
1438 | displayHash( "/cpp_cmd cmd_line" ); displayHash( "/cpp_opt options" ); | 1451 | displayHash( "/cpp_cmd cmd_line" ); displayHash( "/cpp_opt options" ); |
1439 | displayHash( "/cstub filename" ); displayHash( "/dlldata filename" ); displayHash( "/env win32" ); | 1452 | displayHash( "/cstub filename" ); displayHash( "/dlldata filename" ); displayHash( "/env win32" ); |
1440 | displayHash( "/env win64" ); displayHash( "/error all" ); displayHash( "/error allocation" ); | 1453 | displayHash( "/env win64" ); displayHash( "/error all" ); displayHash( "/error allocation" ); |
1441 | displayHash( "/error bounds_check" ); displayHash( "/error enum" ); displayHash( "/error none" ); | 1454 | displayHash( "/error bounds_check" ); displayHash( "/error enum" ); displayHash( "/error none" ); |
1442 | displayHash( "/error ref" ); displayHash( "/error stub_data" ); displayHash( "/h filename" ); | 1455 | displayHash( "/error ref" ); displayHash( "/error stub_data" ); displayHash( "/h filename" ); |
1443 | displayHash( "/header filename" ); displayHash( "/iid filename" ); displayHash( "/lcid" ); | 1456 | displayHash( "/header filename" ); displayHash( "/iid filename" ); displayHash( "/lcid" ); |
1444 | displayHash( "/mktyplib203" ); displayHash( "/ms_ext" ); displayHash( "/ms_union" ); | 1457 | displayHash( "/mktyplib203" ); displayHash( "/ms_ext" ); displayHash( "/ms_union" ); |
1445 | displayHash( "/msc_ver <nnnn>" ); displayHash( "/newtlb" ); displayHash( "/no_cpp" ); | 1458 | displayHash( "/msc_ver <nnnn>" ); displayHash( "/newtlb" ); displayHash( "/no_cpp" ); |
1446 | displayHash( "/no_def_idir" ); displayHash( "/no_default_epv" ); displayHash( "/no_format_opt" ); | 1459 | displayHash( "/no_def_idir" ); displayHash( "/no_default_epv" ); displayHash( "/no_format_opt" ); |
1447 | displayHash( "/no_warn" ); displayHash( "/nocpp" ); displayHash( "/nologo" ); displayHash( "/notlb" ); | 1460 | displayHash( "/no_warn" ); displayHash( "/nocpp" ); displayHash( "/nologo" ); displayHash( "/notlb" ); |
1448 | displayHash( "/o filename" ); displayHash( "/oldnames" ); displayHash( "/oldtlb" ); | 1461 | displayHash( "/o filename" ); displayHash( "/oldnames" ); displayHash( "/oldtlb" ); |
1449 | displayHash( "/osf" ); displayHash( "/out directory" ); displayHash( "/pack {N}" ); | 1462 | displayHash( "/osf" ); displayHash( "/out directory" ); displayHash( "/pack {N}" ); |
1450 | displayHash( "/prefix all" ); displayHash( "/prefix client" ); displayHash( "/prefix server" ); | 1463 | displayHash( "/prefix all" ); displayHash( "/prefix client" ); displayHash( "/prefix server" ); |
1451 | displayHash( "/prefix switch" ); displayHash( "/protocol all" ); displayHash( "/protocol dce" ); | 1464 | displayHash( "/prefix switch" ); displayHash( "/protocol all" ); displayHash( "/protocol dce" ); |
1452 | displayHash( "/protocol ndr64" ); displayHash( "/proxy filename" ); displayHash( "/robust" ); | 1465 | displayHash( "/protocol ndr64" ); displayHash( "/proxy filename" ); displayHash( "/robust" ); |
1453 | displayHash( "/rpcss" ); displayHash( "/savePP" ); displayHash( "/server none" ); | 1466 | displayHash( "/rpcss" ); displayHash( "/savePP" ); displayHash( "/server none" ); |
1454 | displayHash( "/server stub" ); displayHash( "/sstub filename" ); displayHash( "/syntax_check" ); | 1467 | displayHash( "/server stub" ); displayHash( "/sstub filename" ); displayHash( "/syntax_check" ); |
1455 | displayHash( "/target {system}" ); displayHash( "/tlb filename" ); displayHash( "/use_epv" ); | 1468 | displayHash( "/target {system}" ); displayHash( "/tlb filename" ); displayHash( "/use_epv" ); |
1456 | displayHash( "/win32" ); displayHash( "/win64" ); | 1469 | displayHash( "/win32" ); displayHash( "/win64" ); |
1457 | #endif | 1470 | #endif |
1471 | bool found = TRUE; | ||
1458 | int offset = 0; | 1472 | int offset = 0; |
1459 | switch( elfHash(option) ) { | 1473 | switch( elfHash(option) ) { |
1460 | case 0x0000334: // /D name[=def] | 1474 | case 0x0000334: // /D name[=def] |
1461 | PreprocessorDefinitions += option+3; | 1475 | PreprocessorDefinitions += option+3; |
1462 | break; | 1476 | break; |
1463 | case 0x0000339: // /I directory-list | 1477 | case 0x0000339: // /I directory-list |
1464 | AdditionalIncludeDirectories += option+3; | 1478 | AdditionalIncludeDirectories += option+3; |
1465 | break; | 1479 | break; |
1466 | case 0x0345f96: // /Oicf | 1480 | case 0x0345f96: // /Oicf |
1467 | case 0x00345f6: // /Oif | 1481 | case 0x00345f6: // /Oif |
1468 | GenerateStublessProxies = _True; | 1482 | GenerateStublessProxies = _True; |
1469 | break; | 1483 | break; |
1470 | case 0x0000345: // /U name | 1484 | case 0x0000345: // /U name |
1471 | UndefinePreprocessorDefinitions += option+3; | 1485 | UndefinePreprocessorDefinitions += option+3; |
1472 | break; | 1486 | break; |
1473 | case 0x00034c8: // /WX | 1487 | case 0x00034c8: // /WX |
1474 | WarnAsError = _True; | 1488 | WarnAsError = _True; |
1475 | break; | 1489 | break; |
1476 | case 0x3582fde: // /align {N} | 1490 | case 0x3582fde: // /align {N} |
1477 | offset = 3; // Fallthrough | 1491 | offset = 3; // Fallthrough |
1478 | case 0x0003510: // /Zp {N} | 1492 | case 0x0003510: // /Zp {N} |
1479 | switch ( *(option+offset+4) ) { | 1493 | switch ( *(option+offset+4) ) { |
1480 | case '1': | 1494 | case '1': |
1481 | StructMemberAlignment = ( *(option+offset+5) == '\0' ) ? midlAlignSingleByte : midlAlignSixteenBytes; | 1495 | StructMemberAlignment = ( *(option+offset+5) == '\0' ) ? midlAlignSingleByte : midlAlignSixteenBytes; |
1482 | break; | 1496 | break; |
1483 | case '2': | 1497 | case '2': |
1484 | StructMemberAlignment = midlAlignTwoBytes; | 1498 | StructMemberAlignment = midlAlignTwoBytes; |
1485 | break; | 1499 | break; |
1486 | case '4': | 1500 | case '4': |
1487 | StructMemberAlignment = midlAlignFourBytes; | 1501 | StructMemberAlignment = midlAlignFourBytes; |
1488 | break; | 1502 | break; |
1489 | case '8': | 1503 | case '8': |
1490 | StructMemberAlignment = midlAlignEightBytes; | 1504 | StructMemberAlignment = midlAlignEightBytes; |
1491 | break; | 1505 | break; |
1492 | default: | 1506 | default: |
1493 | return FALSE; | 1507 | found = FALSE; |
1494 | } | 1508 | } |
1495 | break; | 1509 | break; |
1496 | case 0x0359e82: // /char {ascii7|signed|unsigned} | 1510 | case 0x0359e82: // /char {ascii7|signed|unsigned} |
1497 | switch( *(option+6) ) { | 1511 | switch( *(option+6) ) { |
1498 | case 'a': | 1512 | case 'a': |
1499 | DefaultCharType = midlCharAscii7; | 1513 | DefaultCharType = midlCharAscii7; |
1500 | break; | 1514 | break; |
1501 | case 's': | 1515 | case 's': |
1502 | DefaultCharType = midlCharSigned; | 1516 | DefaultCharType = midlCharSigned; |
1503 | break; | 1517 | break; |
1504 | case 'u': | 1518 | case 'u': |
1505 | DefaultCharType = midlCharUnsigned; | 1519 | DefaultCharType = midlCharUnsigned; |
1506 | break; | 1520 | break; |
1507 | default: | 1521 | default: |
1508 | return FALSE; | 1522 | found = FALSE; |
1509 | } | 1523 | } |
1510 | break; | 1524 | break; |
1511 | case 0xa766524: // /cpp_opt options | 1525 | case 0xa766524: // /cpp_opt options |
1512 | CPreprocessOptions += option+9; | 1526 | CPreprocessOptions += option+9; |
1513 | break; | 1527 | break; |
1514 | case 0xb32abf1: // /dlldata filename | 1528 | case 0xb32abf1: // /dlldata filename |
1515 | DLLDataFileName = option + 9; | 1529 | DLLDataFileName = option + 9; |
1516 | break; | 1530 | break; |
1517 | case 0x0035c56: // /env {win32|win64} | 1531 | case 0x0035c56: // /env {win32|win64} |
1518 | TargetEnvironment = ( *(option+8) == '6' ) ? midlTargetWin64 : midlTargetWin32; | 1532 | TargetEnvironment = ( *(option+8) == '6' ) ? midlTargetWin64 : midlTargetWin32; |
1519 | break; | 1533 | break; |
1520 | case 0x35c9962: // /error {all|allocation|bounds_check|enum|none|ref|stub_data} | 1534 | case 0x35c9962: // /error {all|allocation|bounds_check|enum|none|ref|stub_data} |
1521 | EnableErrorChecks = midlEnableCustom; | 1535 | EnableErrorChecks = midlEnableCustom; |
1522 | switch ( *(option+7) ) { | 1536 | switch ( *(option+7) ) { |
1523 | case 'a': | 1537 | case 'a': |
1524 | if ( *(option+10) == '\0' ) | 1538 | if ( *(option+10) == '\0' ) |
1525 | EnableErrorChecks = midlEnableAll; | 1539 | EnableErrorChecks = midlEnableAll; |
1526 | else | 1540 | else |
1527 | ErrorCheckAllocations = _True; | 1541 | ErrorCheckAllocations = _True; |
1528 | break; | 1542 | break; |
1529 | case 'b': | 1543 | case 'b': |
1530 | ErrorCheckBounds = _True; | 1544 | ErrorCheckBounds = _True; |
1531 | break; | 1545 | break; |
1532 | case 'e': | 1546 | case 'e': |
1533 | ErrorCheckEnumRange = _True; | 1547 | ErrorCheckEnumRange = _True; |
1534 | break; | 1548 | break; |
1535 | case 'n': | 1549 | case 'n': |
1536 | EnableErrorChecks = midlDisableAll; | 1550 | EnableErrorChecks = midlDisableAll; |
1537 | break; | 1551 | break; |
1538 | case 'r': | 1552 | case 'r': |
1539 | break; | ||
1540 | ErrorCheckRefPointers = _True; | 1553 | ErrorCheckRefPointers = _True; |
1541 | case 's': | ||
1542 | break; | 1554 | break; |
1555 | case 's': | ||
1543 | ErrorCheckStubData = _True; | 1556 | ErrorCheckStubData = _True; |
1557 | break; | ||
1544 | default: | 1558 | default: |
1545 | return FALSE; | 1559 | found = FALSE; |
1546 | } | 1560 | } |
1547 | break; | 1561 | break; |
1548 | case 0x5eb7af2: // /header filename | 1562 | case 0x5eb7af2: // /header filename |
1549 | offset = 5; | 1563 | offset = 5; |
1550 | case 0x0000358: // /h filename | 1564 | case 0x0000358: // /h filename |
1551 | HeaderFileName = option + offset + 3; | 1565 | HeaderFileName = option + offset + 3; |
1552 | break; | 1566 | break; |
1553 | case 0x0035ff4: // /iid filename | 1567 | case 0x0035ff4: // /iid filename |
1554 | InterfaceIdentifierFileName = option+5; | 1568 | InterfaceIdentifierFileName = option+5; |
1555 | break; | 1569 | break; |
1556 | case 0x64b7933: // /mktyplib203 | 1570 | case 0x64b7933: // /mktyplib203 |
1557 | MkTypLibCompatible = _True; | 1571 | MkTypLibCompatible = _True; |
1558 | break; | 1572 | break; |
1559 | case 0x8e0b0a2: // /no_def_idir | 1573 | case 0x8e0b0a2: // /no_def_idir |
1560 | IgnoreStandardIncludePath = _True; | 1574 | IgnoreStandardIncludePath = _True; |
1561 | break; | 1575 | break; |
1562 | case 0x65635ef: // /nologo | 1576 | case 0x65635ef: // /nologo |
1563 | SuppressStartupBanner = _True; | 1577 | SuppressStartupBanner = _True; |
1564 | break; | 1578 | break; |
1565 | case 0x3656b22: // /notlb | 1579 | case 0x3656b22: // /notlb |
1566 | GenerateTypeLibrary = _True; | 1580 | GenerateTypeLibrary = _True; |
1567 | break; | 1581 | break; |
1568 | case 0x000035f: // /o filename | 1582 | case 0x000035f: // /o filename |
1569 | RedirectOutputAndErrors = option+3; | 1583 | RedirectOutputAndErrors = option+3; |
1570 | break; | 1584 | break; |
1571 | case 0x00366c4: // /out directory | 1585 | case 0x00366c4: // /out directory |
1572 | OutputDirectory = option+5; | 1586 | OutputDirectory = option+5; |
1573 | break; | 1587 | break; |
1574 | case 0x36796f9: // /proxy filename | 1588 | case 0x36796f9: // /proxy filename |
1575 | ProxyFileName = option+7; | 1589 | ProxyFileName = option+7; |
1576 | break; | 1590 | break; |
1577 | case 0x6959c94: // /robust | 1591 | case 0x6959c94: // /robust |
1578 | ValidateParameters = _True; | 1592 | ValidateParameters = _True; |
1579 | break; | 1593 | break; |
1580 | case 0x6a88df4: // /target {system} | 1594 | case 0x6a88df4: // /target {system} |
1581 | if ( *(option+11) == '6' ) | 1595 | if ( *(option+11) == '6' ) |
1582 | TargetEnvironment = midlTargetWin64; | 1596 | TargetEnvironment = midlTargetWin64; |
1583 | else | 1597 | else |
1584 | TargetEnvironment = midlTargetWin32; | 1598 | TargetEnvironment = midlTargetWin32; |
1585 | break; | 1599 | break; |
1586 | case 0x0036b22: // /tlb filename | 1600 | case 0x0036b22: // /tlb filename |
1587 | TypeLibraryName = option+5; | 1601 | TypeLibraryName = option+5; |
1588 | break; | 1602 | break; |
1589 | case 0x36e0162: // /win32 | 1603 | case 0x36e0162: // /win32 |
1590 | TargetEnvironment = midlTargetWin32; | 1604 | TargetEnvironment = midlTargetWin32; |
1591 | break; | 1605 | break; |
1592 | case 0x36e0194: // /win64 | 1606 | case 0x36e0194: // /win64 |
1593 | TargetEnvironment = midlTargetWin64; | 1607 | TargetEnvironment = midlTargetWin64; |
@@ -1602,164 +1616,166 @@ bool VCMIDLTool::parseOption( const char* option ) | |||
1602 | case 0x5a2fc64: // /client {none|stub} | 1616 | case 0x5a2fc64: // /client {none|stub} |
1603 | case 0xa64d3dd: // /confirm | 1617 | case 0xa64d3dd: // /confirm |
1604 | case 0xa765b64: // /cpp_cmd cmd_line | 1618 | case 0xa765b64: // /cpp_cmd cmd_line |
1605 | case 0x35aabb2: // /cstub filename | 1619 | case 0x35aabb2: // /cstub filename |
1606 | case 0x03629f4: // /lcid | 1620 | case 0x03629f4: // /lcid |
1607 | case 0x6495cc4: // /ms_ext | 1621 | case 0x6495cc4: // /ms_ext |
1608 | case 0x96c7a1e: // /ms_union | 1622 | case 0x96c7a1e: // /ms_union |
1609 | case 0x4996fa2: // /msc_ver <nnnn> | 1623 | case 0x4996fa2: // /msc_ver <nnnn> |
1610 | case 0x64ceb12: // /newtlb | 1624 | case 0x64ceb12: // /newtlb |
1611 | case 0x6555a40: // /no_cpp | 1625 | case 0x6555a40: // /no_cpp |
1612 | case 0xf64d6a6: // /no_default_epv | 1626 | case 0xf64d6a6: // /no_default_epv |
1613 | case 0x6dd9384: // /no_format_opt | 1627 | case 0x6dd9384: // /no_format_opt |
1614 | case 0x556dbee: // /no_warn | 1628 | case 0x556dbee: // /no_warn |
1615 | case 0x3655a70: // /nocpp | 1629 | case 0x3655a70: // /nocpp |
1616 | case 0x2b455a3: // /oldnames | 1630 | case 0x2b455a3: // /oldnames |
1617 | case 0x662bb12: // /oldtlb | 1631 | case 0x662bb12: // /oldtlb |
1618 | case 0x0036696: // /osf | 1632 | case 0x0036696: // /osf |
1619 | case 0x036679b: // /pack {N} | 1633 | case 0x036679b: // /pack {N} |
1620 | case 0x678bd38: // /prefix {all|client|server|switch} | 1634 | case 0x678bd38: // /prefix {all|client|server|switch} |
1621 | case 0x96b702c: // /protocol {all|dce|ndr64} | 1635 | case 0x96b702c: // /protocol {all|dce|ndr64} |
1622 | case 0x3696aa3: // /rpcss | 1636 | case 0x3696aa3: // /rpcss |
1623 | case 0x698ca60: // /savePP | 1637 | case 0x698ca60: // /savePP |
1624 | case 0x69c9cf2: // /server {none|stub} | 1638 | case 0x69c9cf2: // /server {none|stub} |
1625 | case 0x36aabb2: // /sstub filename | 1639 | case 0x36aabb2: // /sstub filename |
1626 | case 0xce9b12b: // /syntax_check | 1640 | case 0xce9b12b: // /syntax_check |
1627 | case 0xc9b5f16: // /use_epv | 1641 | case 0xc9b5f16: // /use_epv |
1628 | AdditionalOptions += option; | 1642 | AdditionalOptions += option; |
1629 | break; | 1643 | break; |
1630 | default: | 1644 | default: |
1631 | // /W{0|1|2|3|4} case | 1645 | // /W{0|1|2|3|4} case |
1632 | if ( *(option+1) == 'W' ) { | 1646 | if ( *(option+1) == 'W' ) { |
1633 | switch ( *(option+2) ) { | 1647 | switch ( *(option+2) ) { |
1634 | case '0': | 1648 | case '0': |
1635 | WarningLevel = midlWarningLevel_0; | 1649 | WarningLevel = midlWarningLevel_0; |
1636 | break; | 1650 | break; |
1637 | case '1': | 1651 | case '1': |
1638 | WarningLevel = midlWarningLevel_1; | 1652 | WarningLevel = midlWarningLevel_1; |
1639 | break; | 1653 | break; |
1640 | case '2': | 1654 | case '2': |
1641 | WarningLevel = midlWarningLevel_2; | 1655 | WarningLevel = midlWarningLevel_2; |
1642 | break; | 1656 | break; |
1643 | case '3': | 1657 | case '3': |
1644 | WarningLevel = midlWarningLevel_3; | 1658 | WarningLevel = midlWarningLevel_3; |
1645 | break; | 1659 | break; |
1646 | case '4': | 1660 | case '4': |
1647 | WarningLevel = midlWarningLevel_4; | 1661 | WarningLevel = midlWarningLevel_4; |
1648 | break; | 1662 | break; |
1649 | default: | 1663 | default: |
1650 | return FALSE; | 1664 | found = FALSE; |
1651 | } | 1665 | } |
1652 | } | 1666 | } |
1653 | break; | 1667 | break; |
1654 | } | 1668 | } |
1669 | if( !found ) | ||
1670 | warn_msg( WarnLogic, "Could not parse MIDL option: %s", option ); | ||
1655 | return TRUE; | 1671 | return TRUE; |
1656 | } | 1672 | } |
1657 | 1673 | ||
1658 | // VCLibrarianTool -------------------------------------------------- | 1674 | // VCLibrarianTool -------------------------------------------------- |
1659 | VCLibrarianTool::VCLibrarianTool() | 1675 | VCLibrarianTool::VCLibrarianTool() |
1660 | :IgnoreAllDefaultLibraries( unset ), | 1676 | :IgnoreAllDefaultLibraries( unset ), |
1661 | SuppressStartupBanner( _True ) | 1677 | SuppressStartupBanner( _True ) |
1662 | { | 1678 | { |
1663 | } | 1679 | } |
1664 | 1680 | ||
1665 | QTextStream &operator<<( QTextStream &strm, const VCLibrarianTool &tool ) | 1681 | QTextStream &operator<<( QTextStream &strm, const VCLibrarianTool &tool ) |
1666 | { | 1682 | { |
1667 | strm << _begTool3; | 1683 | strm << _begTool3; |
1668 | strm << SPair( _ToolName, QString( "VCLibrarianTool" ) ); | 1684 | strm << SPair( _ToolName, QString( "VCLibrarianTool" ) ); |
1669 | strm << XPair( _AdditionalDependencies4, tool.AdditionalDependencies ); | 1685 | strm << XPair( _AdditionalDependencies4, tool.AdditionalDependencies ); |
1670 | strm << XPair( _AdditionalLibraryDirectories, tool.AdditionalLibraryDirectories ); | 1686 | strm << XPair( _AdditionalLibraryDirectories, tool.AdditionalLibraryDirectories ); |
1671 | strm << XPair( _AdditionalOptions, tool.AdditionalOptions ); | 1687 | strm << XPair( _AdditionalOptions, tool.AdditionalOptions, " " ); |
1672 | strm << XPair( _ExportNamedFunctions, tool.ExportNamedFunctions ); | 1688 | strm << XPair( _ExportNamedFunctions, tool.ExportNamedFunctions ); |
1673 | strm << XPair( _ForceSymbolReferences, tool.ForceSymbolReferences ); | 1689 | strm << XPair( _ForceSymbolReferences, tool.ForceSymbolReferences ); |
1674 | strm << TPair( _IgnoreAllDefaultLibraries, tool.IgnoreAllDefaultLibraries ); | 1690 | strm << TPair( _IgnoreAllDefaultLibraries, tool.IgnoreAllDefaultLibraries ); |
1675 | strm << XPair( _IgnoreDefaultLibraryNames, tool.IgnoreDefaultLibraryNames ); | 1691 | strm << XPair( _IgnoreDefaultLibraryNames, tool.IgnoreDefaultLibraryNames ); |
1676 | strm << SPair( _ModuleDefinitionFile, tool.ModuleDefinitionFile ); | 1692 | strm << SPair( _ModuleDefinitionFile, tool.ModuleDefinitionFile ); |
1677 | strm << SPair( _OutputFile, tool.OutputFile ); | 1693 | strm << SPair( _OutputFile, tool.OutputFile ); |
1678 | strm << TPair( _SuppressStartupBanner, tool.SuppressStartupBanner ); | 1694 | strm << TPair( _SuppressStartupBanner, tool.SuppressStartupBanner ); |
1679 | strm << "/>"; | 1695 | strm << "/>"; |
1680 | return strm; | 1696 | return strm; |
1681 | } | 1697 | } |
1682 | 1698 | ||
1683 | // VCCustomBuildTool ------------------------------------------------ | 1699 | // VCCustomBuildTool ------------------------------------------------ |
1684 | VCCustomBuildTool::VCCustomBuildTool() | 1700 | VCCustomBuildTool::VCCustomBuildTool() |
1685 | { | 1701 | { |
1686 | ToolName = "VCCustomBuildTool"; | 1702 | ToolName = "VCCustomBuildTool"; |
1687 | } | 1703 | } |
1688 | 1704 | ||
1689 | QTextStream &operator<<( QTextStream &strm, const VCCustomBuildTool &tool ) | 1705 | QTextStream &operator<<( QTextStream &strm, const VCCustomBuildTool &tool ) |
1690 | { | 1706 | { |
1691 | strm << _begTool3; | 1707 | strm << _begTool3; |
1692 | strm << SPair( _ToolName, tool.ToolName ); | 1708 | strm << SPair( _ToolName, tool.ToolName ); |
1693 | strm << XPair( _AdditionalDependencies4, tool.AdditionalDependencies, ";" ); | 1709 | strm << XPair( _AdditionalDependencies4, tool.AdditionalDependencies, ";" ); |
1694 | strm << SPair( _CommandLine4, tool.CommandLine ); | 1710 | strm << SPair( _CommandLine4, tool.CommandLine ); |
1695 | strm << SPair( _Description4, tool.Description ); | 1711 | strm << SPair( _Description4, tool.Description ); |
1696 | strm << SPair( _Outputs4, tool.Outputs ); | 1712 | strm << SPair( _Outputs4, tool.Outputs ); |
1697 | strm << SPair( _ToolPath, tool.ToolPath ); | 1713 | strm << SPair( _ToolPath, tool.ToolPath ); |
1698 | strm << "/>"; | 1714 | strm << "/>"; |
1699 | return strm; | 1715 | return strm; |
1700 | } | 1716 | } |
1701 | 1717 | ||
1702 | // VCResourceCompilerTool ------------------------------------------- | 1718 | // VCResourceCompilerTool ------------------------------------------- |
1703 | VCResourceCompilerTool::VCResourceCompilerTool() | 1719 | VCResourceCompilerTool::VCResourceCompilerTool() |
1704 | : Culture( rcUseDefault ), | 1720 | : Culture( rcUseDefault ), |
1705 | IgnoreStandardIncludePath( unset ), | 1721 | IgnoreStandardIncludePath( unset ), |
1706 | ShowProgress( linkProgressNotSet ) | 1722 | ShowProgress( linkProgressNotSet ) |
1707 | { | 1723 | { |
1708 | PreprocessorDefinitions = "NDEBUG"; | 1724 | PreprocessorDefinitions = "NDEBUG"; |
1709 | } | 1725 | } |
1710 | 1726 | ||
1711 | QTextStream &operator<<( QTextStream &strm, const VCResourceCompilerTool &tool ) | 1727 | QTextStream &operator<<( QTextStream &strm, const VCResourceCompilerTool &tool ) |
1712 | { | 1728 | { |
1713 | strm << _begTool3; | 1729 | strm << _begTool3; |
1714 | strm << _VCResourceCompilerToolName; | 1730 | strm << _VCResourceCompilerToolName; |
1715 | strm << SPair( _ToolPath, tool.ToolPath ); | 1731 | strm << SPair( _ToolPath, tool.ToolPath ); |
1716 | strm << XPair( _AdditionalIncludeDirectories, tool.AdditionalIncludeDirectories ); | 1732 | strm << XPair( _AdditionalIncludeDirectories, tool.AdditionalIncludeDirectories ); |
1717 | strm << XPair( _AdditionalOptions, tool.AdditionalOptions ); | 1733 | strm << XPair( _AdditionalOptions, tool.AdditionalOptions, " " ); |
1718 | if ( tool.Culture != rcUseDefault ) strm << EPair( _Culture, tool.Culture ); | 1734 | if ( tool.Culture != rcUseDefault ) strm << EPair( _Culture, tool.Culture ); |
1719 | strm << XPair( _FullIncludePath, tool.FullIncludePath ); | 1735 | strm << XPair( _FullIncludePath, tool.FullIncludePath ); |
1720 | strm << TPair( _IgnoreStandardIncludePath, tool.IgnoreStandardIncludePath ); | 1736 | strm << TPair( _IgnoreStandardIncludePath, tool.IgnoreStandardIncludePath ); |
1721 | strm << XPair( _PreprocessorDefinitions, tool.PreprocessorDefinitions ); | 1737 | strm << XPair( _PreprocessorDefinitions, tool.PreprocessorDefinitions ); |
1722 | strm << SPair( _ResourceOutputFileName, tool.ResourceOutputFileName ); | 1738 | strm << SPair( _ResourceOutputFileName, tool.ResourceOutputFileName ); |
1723 | if ( tool.ShowProgress != linkProgressNotSet ) strm << EPair( _ShowProgress, tool.ShowProgress ); | 1739 | if ( tool.ShowProgress != linkProgressNotSet ) strm << EPair( _ShowProgress, tool.ShowProgress ); |
1724 | strm << "/>"; | 1740 | strm << "/>"; |
1725 | return strm; | 1741 | return strm; |
1726 | } | 1742 | } |
1727 | 1743 | ||
1728 | // VCEventTool ------------------------------------------------- | 1744 | // VCEventTool ------------------------------------------------- |
1729 | QTextStream &operator<<( QTextStream &strm, const VCEventTool &tool ) | 1745 | QTextStream &operator<<( QTextStream &strm, const VCEventTool &tool ) |
1730 | { | 1746 | { |
1731 | strm << _begTool3; | 1747 | strm << _begTool3; |
1732 | strm << SPair( _ToolName, tool.ToolName ); | 1748 | strm << SPair( _ToolName, tool.ToolName ); |
1733 | strm << SPair( _ToolPath, tool.ToolPath ); | 1749 | strm << SPair( _ToolPath, tool.ToolPath ); |
1734 | strm << SPair( _CommandLine4, tool.CommandLine ); | 1750 | strm << SPair( _CommandLine4, tool.CommandLine ); |
1735 | strm << SPair( _Description4, tool.Description ); | 1751 | strm << SPair( _Description4, tool.Description ); |
1736 | strm << TPair( _ExcludedFromBuild, tool.ExcludedFromBuild ); | 1752 | strm << TPair( _ExcludedFromBuild, tool.ExcludedFromBuild ); |
1737 | strm << "/>"; | 1753 | strm << "/>"; |
1738 | return strm; | 1754 | return strm; |
1739 | } | 1755 | } |
1740 | 1756 | ||
1741 | // VCPostBuildEventTool --------------------------------------------- | 1757 | // VCPostBuildEventTool --------------------------------------------- |
1742 | VCPostBuildEventTool::VCPostBuildEventTool() | 1758 | VCPostBuildEventTool::VCPostBuildEventTool() |
1743 | { | 1759 | { |
1744 | ToolName = "VCPostBuildEventTool"; | 1760 | ToolName = "VCPostBuildEventTool"; |
1745 | } | 1761 | } |
1746 | 1762 | ||
1747 | // VCPreBuildEventTool ---------------------------------------------- | 1763 | // VCPreBuildEventTool ---------------------------------------------- |
1748 | VCPreBuildEventTool::VCPreBuildEventTool() | 1764 | VCPreBuildEventTool::VCPreBuildEventTool() |
1749 | { | 1765 | { |
1750 | ToolName = "VCPreBuildEventTool"; | 1766 | ToolName = "VCPreBuildEventTool"; |
1751 | } | 1767 | } |
1752 | 1768 | ||
1753 | // VCPreLinkEventTool ----------------------------------------------- | 1769 | // VCPreLinkEventTool ----------------------------------------------- |
1754 | VCPreLinkEventTool::VCPreLinkEventTool() | 1770 | VCPreLinkEventTool::VCPreLinkEventTool() |
1755 | { | 1771 | { |
1756 | ToolName = "VCPreLinkEventTool"; | 1772 | ToolName = "VCPreLinkEventTool"; |
1757 | } | 1773 | } |
1758 | 1774 | ||
1759 | // VCConfiguration -------------------------------------------------- | 1775 | // VCConfiguration -------------------------------------------------- |
1760 | 1776 | ||
1761 | VCConfiguration::VCConfiguration() | 1777 | VCConfiguration::VCConfiguration() |
1762 | :ATLMinimizesCRunTimeLibraryUsage( unset ), | 1778 | :ATLMinimizesCRunTimeLibraryUsage( unset ), |
1763 | BuildBrowserInformation( unset ), | 1779 | BuildBrowserInformation( unset ), |
1764 | CharacterSet( charSetNotSet ), | 1780 | CharacterSet( charSetNotSet ), |
1765 | ConfigurationType( typeApplication ), | 1781 | ConfigurationType( typeApplication ), |
@@ -1806,150 +1822,171 @@ QTextStream &operator<<( QTextStream &strm, const VCConfiguration &tool ) | |||
1806 | strm << _endConfiguration; | 1822 | strm << _endConfiguration; |
1807 | return strm; | 1823 | return strm; |
1808 | } | 1824 | } |
1809 | // VCFilter --------------------------------------------------------- | 1825 | // VCFilter --------------------------------------------------------- |
1810 | VCFilter::VCFilter() | 1826 | VCFilter::VCFilter() |
1811 | : ParseFiles( unset ) | 1827 | : ParseFiles( unset ) |
1812 | { | 1828 | { |
1813 | } | 1829 | } |
1814 | 1830 | ||
1815 | void VCFilter::generateMOC( QTextStream &strm, QString str ) const | 1831 | void VCFilter::generateMOC( QTextStream &strm, QString str ) const |
1816 | { | 1832 | { |
1817 | QString mocOutput = Project->findMocDestination( str ); | 1833 | QString mocOutput = Project->findMocDestination( str ); |
1818 | QString mocApp = Project->var( "QMAKE_MOC" ); | 1834 | QString mocApp = Project->var( "QMAKE_MOC" ); |
1819 | 1835 | ||
1820 | if( mocOutput.isEmpty() ) { | 1836 | if( mocOutput.isEmpty() ) { |
1821 | // In specialcases we DO moc .cpp files | 1837 | // In specialcases we DO moc .cpp files |
1822 | // when the result is an .moc file | 1838 | // when the result is an .moc file |
1823 | if ( !str.endsWith(".moc") ) | 1839 | if ( !str.endsWith(".moc") ) |
1824 | return; | 1840 | return; |
1825 | mocOutput = str; | 1841 | mocOutput = str; |
1826 | str = Project->findMocSource( mocOutput ); | 1842 | str = Project->findMocSource( mocOutput ); |
1827 | } | 1843 | } |
1828 | 1844 | ||
1829 | strm << _begFileConfiguration; | 1845 | strm << _begFileConfiguration; |
1830 | strm << _Name5; | 1846 | strm << _Name5; |
1831 | strm << Config->Name; | 1847 | strm << Config->Name; |
1832 | strm << "\">"; | 1848 | strm << "\">"; |
1833 | strm << _begTool5; | 1849 | strm << _begTool5; |
1834 | strm << _VCCustomBuildTool; | 1850 | strm << _VCCustomBuildTool; |
1835 | strm << _Description6; | 1851 | strm << _Description6; |
1836 | strm << "Moc'ing " << str << "...\""; | 1852 | strm << "Moc'ing " << str << "...\""; |
1837 | strm << _CommandLine6; | 1853 | strm << _CommandLine6; |
1838 | strm << mocApp; | 1854 | strm << mocApp; |
1839 | strm << " " << str << " -o " << mocOutput << "\""; | 1855 | strm << " " << str << " -o " << mocOutput << "\""; |
1840 | strm << _AdditionalDependencies6; | 1856 | strm << _AdditionalDependencies6; |
1841 | strm << mocApp << "\""; | 1857 | strm << mocApp << "\""; |
1842 | strm << _Outputs6; | 1858 | strm << _Outputs6; |
1843 | strm << mocOutput << "\""; | 1859 | strm << mocOutput << "\""; |
1844 | strm << "/>"; | 1860 | strm << "/>"; |
1845 | strm << _endFileConfiguration; | 1861 | strm << _endFileConfiguration; |
1846 | } | 1862 | } |
1847 | 1863 | ||
1848 | void VCFilter::generateUIC( QTextStream &strm, const QString& str ) const | 1864 | void VCFilter::generateUIC( QTextStream &strm, const QString& str ) const |
1849 | { | 1865 | { |
1850 | QString uicApp = Project->var("QMAKE_UIC"); | 1866 | QString uicApp = Project->var("QMAKE_UIC"); |
1851 | QString mocApp = Project->var( "QMAKE_MOC" ); | 1867 | QString mocApp = Project->var( "QMAKE_MOC" ); |
1852 | QString fname = str.section( '\\', -1 ); | 1868 | QString fname = str.section( '\\', -1 ); |
1853 | QString mocDir = Project->var( "MOC_DIR" ); | 1869 | QString mocDir = Project->var( "MOC_DIR" ); |
1870 | QString uiDir = Project->var( "UI_DIR" ); | ||
1871 | QString uiHeaders; | ||
1872 | QString uiSources; | ||
1873 | |||
1874 | // Determining the paths for the output files. | ||
1875 | int slash = str.findRev( '\\' ); | ||
1876 | QString pname = ( slash != -1 ) ? str.left( slash+1 ) : QString( ".\\" ); | ||
1877 | if( !uiDir.isEmpty() ) { | ||
1878 | uiHeaders = uiDir; | ||
1879 | uiSources = uiDir; | ||
1880 | } else { | ||
1881 | uiHeaders = Project->var( "UI_HEADERS_DIR" ); | ||
1882 | uiSources = Project->var( "UI_SOURCES_DIR" ); | ||
1883 | if( uiHeaders.isEmpty() ) | ||
1884 | uiHeaders = pname; | ||
1885 | if( uiSources.isEmpty() ) | ||
1886 | uiSources = pname; | ||
1887 | } | ||
1888 | if( !uiHeaders.endsWith( "\\" ) ) | ||
1889 | uiHeaders += "\\"; | ||
1890 | if( !uiSources.endsWith( "\\" ) ) | ||
1891 | uiSources += "\\"; | ||
1892 | |||
1893 | // Determine the file name. | ||
1854 | int dot = fname.findRev( '.' ); | 1894 | int dot = fname.findRev( '.' ); |
1855 | if( dot != -1 ) | 1895 | if( dot != -1 ) |
1856 | fname.truncate( dot ); | 1896 | fname.truncate( dot ); |
1857 | 1897 | ||
1858 | int slash = str.findRev( '\\' ); | ||
1859 | QString pname = ( slash != -1 ) ? str.left( slash+1 ) : QString(".\\"); | ||
1860 | |||
1861 | strm << _begFileConfiguration; | 1898 | strm << _begFileConfiguration; |
1862 | strm << _Name5; | 1899 | strm << _Name5; |
1863 | strm << Config->Name; | 1900 | strm << Config->Name; |
1864 | strm << "\">"; | 1901 | strm << "\">"; |
1865 | strm << _begTool5; | 1902 | strm << _begTool5; |
1866 | strm << _VCCustomBuildTool; | 1903 | strm << _VCCustomBuildTool; |
1867 | strm << _Description6; | 1904 | strm << _Description6; |
1868 | strm << "Uic'ing " << str << "...\""; | 1905 | strm << "Uic'ing " << str << "...\""; |
1869 | strm << _CommandLine6; | 1906 | strm << _CommandLine6; |
1870 | strm << uicApp << " " << str << " -o " << pname << fname << ".h && "; // Create .h from .ui file | 1907 | strm << uicApp << " " << str << " -o " << uiHeaders << fname << ".h && "; // Create .h from .ui file |
1871 | strm << uicApp << " " << str << " -i " << fname << ".h -o " << pname << fname << ".cpp && ";// Create .cpp from .ui file | 1908 | strm << uicApp << " " << str << " -i " << fname << ".h -o " << uiSources << fname << ".cpp && ";// Create .cpp from .ui file |
1872 | strm << mocApp << " " << pname << fname << ".h -o " << mocDir << "moc_" << fname << ".cpp\""; | 1909 | strm << mocApp << " " << uiHeaders << fname << ".h -o " << mocDir << "moc_" << fname << ".cpp\""; |
1873 | strm << _AdditionalDependencies6; | 1910 | strm << _AdditionalDependencies6; |
1874 | strm << mocApp << ";" << uicApp << "\""; | 1911 | strm << mocApp << ";" << uicApp << "\""; |
1875 | strm << _Outputs6; | 1912 | strm << _Outputs6; |
1876 | strm << pname << fname << ".h;" << pname << fname << ".cpp;" << mocDir << "moc_" << fname << ".cpp\""; | 1913 | strm << uiHeaders << fname << ".h;" << uiSources << fname << ".cpp;" << mocDir << "moc_" << fname << ".cpp\""; |
1877 | strm << "/>"; | 1914 | strm << "/>"; |
1878 | strm << _endFileConfiguration; | 1915 | strm << _endFileConfiguration; |
1879 | } | 1916 | } |
1880 | 1917 | ||
1881 | QTextStream &operator<<( QTextStream &strm, const VCFilter &tool ) | 1918 | QTextStream &operator<<( QTextStream &strm, const VCFilter &tool ) |
1882 | { | 1919 | { |
1883 | if ( tool.Files.count() == 0 ) | 1920 | if ( tool.Files.count() == 0 ) |
1884 | return strm; | 1921 | return strm; |
1885 | 1922 | ||
1886 | strm << _begFilter; | 1923 | strm << _begFilter; |
1887 | strm << SPair( _Name3, tool.Name ); | 1924 | strm << SPair( _Name3, tool.Name ); |
1888 | strm << TPair( _ParseFiles, tool.ParseFiles ); | 1925 | strm << TPair( _ParseFiles, tool.ParseFiles ); |
1889 | strm << SPair( _Filter, tool.Filter ); | 1926 | strm << SPair( _Filter, tool.Filter ); |
1890 | strm << ">"; | 1927 | strm << ">"; |
1891 | for ( QStringList::ConstIterator it = tool.Files.begin(); it != tool.Files.end(); ++it ) { | 1928 | for ( QStringList::ConstIterator it = tool.Files.begin(); it != tool.Files.end(); ++it ) { |
1892 | strm << _begFile; | 1929 | strm << _begFile; |
1893 | strm << SPair( _RelativePath, *it ); | 1930 | strm << SPair( _RelativePath, *it ); |
1894 | strm << ">"; | 1931 | strm << ">"; |
1895 | if ( tool.CustomBuild == moc ) | 1932 | if ( tool.CustomBuild == moc ) |
1896 | tool.generateMOC( strm, *it ); | 1933 | tool.generateMOC( strm, *it ); |
1897 | else if ( tool.CustomBuild == uic ) | 1934 | else if ( tool.CustomBuild == uic ) |
1898 | tool.generateUIC( strm, *it ); | 1935 | tool.generateUIC( strm, *it ); |
1899 | strm << _endFile; | 1936 | strm << _endFile; |
1900 | } | 1937 | } |
1901 | 1938 | ||
1902 | strm << _endFilter; | 1939 | strm << _endFilter; |
1903 | return strm; | 1940 | return strm; |
1904 | } | 1941 | } |
1905 | 1942 | ||
1906 | // VCProject -------------------------------------------------------- | 1943 | // VCProject -------------------------------------------------------- |
1907 | VCProject::VCProject() | 1944 | VCProject::VCProject() |
1908 | { | 1945 | { |
1909 | QUuid uniqueId; | ||
1910 | #if defined(Q_WS_WIN32) | 1946 | #if defined(Q_WS_WIN32) |
1911 | GUID guid; | 1947 | GUID guid; |
1948 | QUuid uniqueId; | ||
1912 | HRESULT h = CoCreateGuid( &guid ); | 1949 | HRESULT h = CoCreateGuid( &guid ); |
1913 | if ( h == S_OK ) | 1950 | if ( h == S_OK ) |
1914 | uniqueId = QUuid( guid ); | 1951 | uniqueId = QUuid( guid ); |
1915 | ProjectGUID = uniqueId.toString(); | 1952 | ProjectGUID = uniqueId.toString(); |
1916 | #else | 1953 | #else |
1917 | // Qt doesn't support GUID on other platforms yet | 1954 | // Qt doesn't support GUID on other platforms yet |
1918 | ProjectGUID = ""; | 1955 | ProjectGUID = ""; |
1919 | #endif | 1956 | #endif |
1920 | } | 1957 | } |
1921 | 1958 | ||
1922 | QTextStream &operator<<( QTextStream &strm, const VCProject &tool ) | 1959 | QTextStream &operator<<( QTextStream &strm, const VCProject &tool ) |
1923 | { | 1960 | { |
1924 | strm << _xmlInit; | 1961 | strm << _xmlInit; |
1925 | strm << _begVisualStudioProject; | 1962 | strm << _begVisualStudioProject; |
1926 | strm << _ProjectType; | 1963 | strm << _ProjectType; |
1927 | strm << SPair( _Version1, tool.Version ); | 1964 | strm << SPair( _Version1, tool.Version ); |
1928 | strm << SPair( _Name1, tool.Name ); | 1965 | strm << SPair( _Name1, tool.Name ); |
1929 | strm << SPair( _ProjectGUID, tool.ProjectGUID ); | 1966 | strm << SPair( _ProjectGUID, tool.ProjectGUID ); |
1930 | strm << SPair( _SccProjectName, tool.SccProjectName ); | 1967 | strm << SPair( _SccProjectName, tool.SccProjectName ); |
1931 | strm << SPair( _SccLocalPath, tool.SccLocalPath ); | 1968 | strm << SPair( _SccLocalPath, tool.SccLocalPath ); |
1932 | strm << ">"; | 1969 | strm << ">"; |
1933 | strm << _begPlatforms; | 1970 | strm << _begPlatforms; |
1934 | strm << _begPlatform; | 1971 | strm << _begPlatform; |
1935 | strm << SPair( _Name3, tool.PlatformName ); | 1972 | strm << SPair( _Name3, tool.PlatformName ); |
1936 | strm << "/>"; | 1973 | strm << "/>"; |
1937 | strm << _endPlatforms; | 1974 | strm << _endPlatforms; |
1938 | strm << _begConfigurations; | 1975 | strm << _begConfigurations; |
1939 | strm << tool.Configuration; | 1976 | strm << tool.Configuration; |
1940 | strm << _endConfigurations; | 1977 | strm << _endConfigurations; |
1941 | strm << _begFiles; | 1978 | strm << _begFiles; |
1942 | strm << tool.SourceFiles; | 1979 | strm << tool.SourceFiles; |
1943 | strm << tool.HeaderFiles; | 1980 | strm << tool.HeaderFiles; |
1944 | strm << tool.MOCFiles; | 1981 | strm << tool.MOCFiles; |
1945 | strm << tool.UICFiles; | 1982 | strm << tool.UICFiles; |
1946 | strm << tool.FormFiles; | 1983 | strm << tool.FormFiles; |
1947 | strm << tool.TranslationFiles; | 1984 | strm << tool.TranslationFiles; |
1948 | strm << tool.LexYaccFiles; | 1985 | strm << tool.LexYaccFiles; |
1949 | strm << tool.ResourceFiles; | 1986 | strm << tool.ResourceFiles; |
1950 | strm << _endFiles; | 1987 | strm << _endFiles; |
1951 | strm << _begGlobals; | 1988 | strm << _begGlobals; |
1952 | strm << _endGlobals; | 1989 | strm << _endGlobals; |
1953 | strm << _endVisualStudioProject; | 1990 | strm << _endVisualStudioProject; |
1954 | return strm; | 1991 | return strm; |
1955 | } | 1992 | } |