summaryrefslogtreecommitdiff
path: root/qmake/generators/win32/msvc_objectmodel.cpp
Unidiff
Diffstat (limited to 'qmake/generators/win32/msvc_objectmodel.cpp') (more/less context) (show whitespace changes)
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp155
1 files changed, 96 insertions, 59 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
@@ -385,3 +385,3 @@ QTextStream &operator<<( QTextStream &strm, const VCCLCompilerTool &tool )
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 );
@@ -456,2 +456,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
456 char fourth = option[4]; 456 char fourth = option[4];
457 bool found = TRUE;
457 458
@@ -461,13 +462,16 @@ bool VCCLCompilerTool::parseOption( const char* option )
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;
@@ -489,3 +493,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
489 } 493 }
490 return FALSE; 494 found = FALSE; break;
491 } 495 }
@@ -546,3 +550,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
546 default: 550 default:
547 return FALSE; 551 found = FALSE; break;
548 } 552 }
@@ -555,3 +559,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
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':
@@ -621,3 +625,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
621 default: 625 default:
622 return FALSE; 626 found = FALSE; break;
623 } 627 }
@@ -635,3 +639,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
635 } 639 }
636 return FALSE; 640 found = FALSE; break;
637 case 'M': 641 case 'M':
@@ -653,3 +657,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
653 } 657 }
654 return FALSE; 658 found = FALSE; break;
655 case 'O': 659 case 'O':
@@ -673,3 +677,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
673 else 677 else
674 return FALSE; 678 found = FALSE;
675 break; 679 break;
@@ -707,3 +711,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
707 default: 711 default:
708 return FALSE; 712 found = FALSE; break;
709 } 713 }
@@ -718,3 +722,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
718 } 722 }
719 return FALSE; 723 found = FALSE; break;
720 case 'R': 724 case 'R':
@@ -730,3 +734,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
730 else 734 else
731 return FALSE; 735 found = FALSE; break;
732 } 736 }
@@ -740,3 +744,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
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 }
@@ -780,3 +784,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
780 default: 784 default:
781 return FALSE; 785 found = FALSE; break;
782 } 786 }
@@ -809,3 +813,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
809 default: 813 default:
810 return FALSE; 814 found = FALSE; break;
811 } 815 }
@@ -842,5 +846,5 @@ bool VCCLCompilerTool::parseOption( const char* option )
842 else 846 else
843 return FALSE; 847 found = FALSE;
844 } else { 848 } else {
845 return FALSE; 849 found = FALSE; break;
846 } 850 }
@@ -871,3 +875,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
871 default: 875 default:
872 return FALSE; 876 found = FALSE; break;
873 } 877 }
@@ -875,3 +879,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
875 default: 879 default:
876 return FALSE; 880 found = FALSE; break;
877 } 881 }
@@ -889,3 +893,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
889 } else { 893 } else {
890 return FALSE; 894 found = FALSE; break;
891 } 895 }
@@ -893,4 +897,5 @@ bool VCCLCompilerTool::parseOption( const char* option )
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;
@@ -906,3 +911,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
906 } 911 }
907 return FALSE; 912 found = FALSE; break;
908 case 's': 913 case 's':
@@ -912,3 +917,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
912 } 917 }
913 return FALSE; 918 found = FALSE; break;
914 case 'u': 919 case 'u':
@@ -921,3 +926,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
921 } 926 }
922 return FALSE; 927 found = FALSE; break;
923 case 'w': 928 case 'w':
@@ -935,4 +940,6 @@ bool VCCLCompilerTool::parseOption( const char* option )
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;
@@ -982,3 +989,3 @@ QTextStream &operator<<( QTextStream &strm, const VCLinkerTool &tool )
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 );
@@ -1062,2 +1069,5 @@ static uint elfHash( const char* name )
1062} 1069}
1070
1071//#define USE_DISPLAY_HASH
1072#ifdef USE_DISPLAY_HASH
1063static void displayHash( const char* str ) 1073static void displayHash( const char* str )
@@ -1066,2 +1076,3 @@ static void displayHash( const char* str )
1066} 1076}
1077#endif
1067 1078
@@ -1069,3 +1080,3 @@ bool VCLinkerTool::parseOption( const char* option )
1069{ 1080{
1070#if 0 1081#ifdef USE_DISPLAY_HASH
1071 // Main options 1082 // Main options
@@ -1090,3 +1101,3 @@ bool VCLinkerTool::parseOption( const char* option )
1090#endif 1101#endif
1091#if 0 1102#ifdef USE_DISPLAY_HASH
1092 // Sub options 1103 // Sub options
@@ -1100,3 +1111,3 @@ bool VCLinkerTool::parseOption( const char* option )
1100#endif 1111#endif
1101 1112 bool found = TRUE;
1102 switch ( elfHash(option) ) { 1113 switch ( elfHash(option) ) {
@@ -1218,3 +1229,3 @@ bool VCLinkerTool::parseOption( const char* option )
1218 default: 1229 default:
1219 return FALSE; 1230 found = FALSE;
1220 } 1231 }
@@ -1277,3 +1288,3 @@ bool VCLinkerTool::parseOption( const char* option )
1277 default: 1288 default:
1278 return FALSE; 1289 found = FALSE;
1279 } 1290 }
@@ -1326,3 +1337,3 @@ bool VCLinkerTool::parseOption( const char* option )
1326 default: 1337 default:
1327 return FALSE; 1338 found = FALSE;
1328 } 1339 }
@@ -1336,3 +1347,3 @@ bool VCLinkerTool::parseOption( const char* option )
1336 else 1347 else
1337 return FALSE; 1348 found = FALSE;
1338 break; 1349 break;
@@ -1362,5 +1373,7 @@ bool VCLinkerTool::parseOption( const char* option )
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}
@@ -1394,3 +1407,3 @@ QTextStream &operator<<( QTextStream &strm, const VCMIDLTool &tool )
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 );
@@ -1429,3 +1442,3 @@ 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" );
@@ -1457,2 +1470,3 @@ bool VCMIDLTool::parseOption( const char* option )
1457#endif 1470#endif
1471 bool found = TRUE;
1458 int offset = 0; 1472 int offset = 0;
@@ -1492,3 +1506,3 @@ bool VCMIDLTool::parseOption( const char* option )
1492 default: 1506 default:
1493 return FALSE; 1507 found = FALSE;
1494 } 1508 }
@@ -1507,3 +1521,3 @@ bool VCMIDLTool::parseOption( const char* option )
1507 default: 1521 default:
1508 return FALSE; 1522 found = FALSE;
1509 } 1523 }
@@ -1538,9 +1552,9 @@ bool VCMIDLTool::parseOption( const char* option )
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 }
@@ -1649,3 +1663,3 @@ bool VCMIDLTool::parseOption( const char* option )
1649 default: 1663 default:
1650 return FALSE; 1664 found = FALSE;
1651 } 1665 }
@@ -1654,2 +1668,4 @@ bool VCMIDLTool::parseOption( const char* option )
1654 } 1668 }
1669 if( !found )
1670 warn_msg( WarnLogic, "Could not parse MIDL option: %s", option );
1655 return TRUE; 1671 return TRUE;
@@ -1670,3 +1686,3 @@ QTextStream &operator<<( QTextStream &strm, const VCLibrarianTool &tool )
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 );
@@ -1716,3 +1732,3 @@ QTextStream &operator<<( QTextStream &strm, const VCResourceCompilerTool &tool )
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 );
@@ -1853,8 +1869,29 @@ void VCFilter::generateUIC( QTextStream &strm, const QString& str ) const
1853 QString mocDir = Project->var( "MOC_DIR" ); 1869 QString mocDir = Project->var( "MOC_DIR" );
1854 int dot = fname.findRev( '.' ); 1870 QString uiDir = Project->var( "UI_DIR" );
1855 if( dot != -1 ) 1871 QString uiHeaders;
1856 fname.truncate( dot ); 1872 QString uiSources;
1857 1873
1874 // Determining the paths for the output files.
1858 int slash = str.findRev( '\\' ); 1875 int slash = str.findRev( '\\' );
1859 QString pname = ( slash != -1 ) ? str.left( slash+1 ) : QString(".\\"); 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.
1894 int dot = fname.findRev( '.' );
1895 if( dot != -1 )
1896 fname.truncate( dot );
1860 1897
@@ -1869,5 +1906,5 @@ void VCFilter::generateUIC( QTextStream &strm, const QString& str ) const
1869 strm << _CommandLine6; 1906 strm << _CommandLine6;
1870 strm << uicApp << " " << str << " -o " << pname << fname << ".h &amp;&amp; "; // Create .h from .ui file 1907 strm << uicApp << " " << str << " -o " << uiHeaders << fname << ".h &amp;&amp; "; // Create .h from .ui file
1871 strm << uicApp << " " << str << " -i " << fname << ".h -o " << pname << fname << ".cpp &amp;&amp; ";// Create .cpp from .ui file 1908 strm << uicApp << " " << str << " -i " << fname << ".h -o " << uiSources << fname << ".cpp &amp;&amp; ";// 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;
@@ -1875,3 +1912,3 @@ void VCFilter::generateUIC( QTextStream &strm, const QString& str ) const
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 << "/>";
@@ -1908,5 +1945,5 @@ 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 );