summaryrefslogtreecommitdiff
path: root/qmake/generators/win32/msvc_objectmodel.cpp
Side-by-side diff
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 )
strm << XPair( _AdditionalIncludeDirectories, tool.AdditionalIncludeDirectories );
- strm << XPair( _AdditionalOptions, tool.AdditionalOptions );
+ strm << XPair( _AdditionalOptions, tool.AdditionalOptions, " " );
strm << XPair( _AdditionalUsingDirectories, tool.AdditionalUsingDirectories );
@@ -456,2 +456,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
char fourth = option[4];
+ bool found = TRUE;
@@ -461,13 +462,16 @@ bool VCCLCompilerTool::parseOption( const char* option )
qWarning( "Generator: Option '/?', '/help': MSVC.NET projects do not support outputting help info" );
- return FALSE;
+ found = FALSE;
+ break;
case '@':
qWarning( "Generator: Option '/@': MSVC.NET projects do not support the use of a response file" );
- return FALSE;
+ found = FALSE;
+ break;
case 'l':
qWarning( "Generator: Option '/link': qmake generator does not support passing link options through the compiler tool" );
- return FALSE;
-
+ found = FALSE;
+ break;
case 'A':
- if ( second != 'I' )
- return FALSE;
+ if ( second != 'I' ) {
+ found = FALSE; break;
+ }
AdditionalUsingDirectories += option+2;
@@ -489,3 +493,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
}
- return FALSE;
+ found = FALSE; break;
}
@@ -546,3 +550,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
default:
- return FALSE;
+ found = FALSE; break;
}
@@ -555,3 +559,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
qWarning( "Option '/G3' and '/G4' were phased out in Visual C++ 5.0" );
- return FALSE;
+ found = FALSE; break;
case '5':
@@ -621,3 +625,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
default:
- return FALSE;
+ found = FALSE; break;
}
@@ -635,3 +639,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
}
- return FALSE;
+ found = FALSE; break;
case 'M':
@@ -653,3 +657,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
}
- return FALSE;
+ found = FALSE; break;
case 'O':
@@ -673,3 +677,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
else
- return FALSE;
+ found = FALSE;
break;
@@ -707,3 +711,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
default:
- return FALSE;
+ found = FALSE; break;
}
@@ -718,3 +722,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
}
- return FALSE;
+ found = FALSE; break;
case 'R':
@@ -730,3 +734,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
else
- return FALSE;
+ found = FALSE; break;
}
@@ -740,3 +744,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
qWarning( "Generator: Options '/Tp<filename>' and '/Tc<filename>' are not supported by qmake" );
- return FALSE;
+ found = FALSE; break;
}
@@ -780,3 +784,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
default:
- return FALSE;
+ found = FALSE; break;
}
@@ -809,3 +813,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
default:
- return FALSE;
+ found = FALSE; break;
}
@@ -842,5 +846,5 @@ bool VCCLCompilerTool::parseOption( const char* option )
else
- return FALSE;
+ found = FALSE;
} else {
- return FALSE;
+ found = FALSE; break;
}
@@ -871,3 +875,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
default:
- return FALSE;
+ found = FALSE; break;
}
@@ -875,3 +879,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
default:
- return FALSE;
+ found = FALSE; break;
}
@@ -889,3 +893,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
} else {
- return FALSE;
+ found = FALSE; break;
}
@@ -893,4 +897,5 @@ bool VCCLCompilerTool::parseOption( const char* option )
case 'd':
- if ( second != 'r' )
- return FALSE;
+ if ( second != 'r' ) {
+ found = FALSE; break;
+ }
CompileAsManaged = managedAssembly;
@@ -906,3 +911,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
}
- return FALSE;
+ found = FALSE; break;
case 's':
@@ -912,3 +917,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
}
- return FALSE;
+ found = FALSE; break;
case 'u':
@@ -921,3 +926,3 @@ bool VCCLCompilerTool::parseOption( const char* option )
}
- return FALSE;
+ found = FALSE; break;
case 'w':
@@ -935,4 +940,6 @@ bool VCCLCompilerTool::parseOption( const char* option )
default:
- return FALSE;
+ found = FALSE; break;
}
+ if( !found )
+ warn_msg( WarnLogic, "Could not parse Compiler option: %s", option );
return TRUE;
@@ -982,3 +989,3 @@ QTextStream &operator<<( QTextStream &strm, const VCLinkerTool &tool )
strm << XPair( _AdditionalLibraryDirectories, tool.AdditionalLibraryDirectories );
- strm << XPair( _AdditionalOptions, tool.AdditionalOptions );
+ strm << XPair( _AdditionalOptions, tool.AdditionalOptions, " " );
strm << XPair( _AddModuleNamesToAssembly, tool.AddModuleNamesToAssembly );
@@ -1062,2 +1069,5 @@ static uint elfHash( const char* name )
}
+
+//#define USE_DISPLAY_HASH
+#ifdef USE_DISPLAY_HASH
static void displayHash( const char* str )
@@ -1066,2 +1076,3 @@ static void displayHash( const char* str )
}
+#endif
@@ -1069,3 +1080,3 @@ bool VCLinkerTool::parseOption( const char* option )
{
-#if 0
+#ifdef USE_DISPLAY_HASH
// Main options
@@ -1090,3 +1101,3 @@ bool VCLinkerTool::parseOption( const char* option )
#endif
-#if 0
+#ifdef USE_DISPLAY_HASH
// Sub options
@@ -1100,3 +1111,3 @@ bool VCLinkerTool::parseOption( const char* option )
#endif
-
+ bool found = TRUE;
switch ( elfHash(option) ) {
@@ -1218,3 +1229,3 @@ bool VCLinkerTool::parseOption( const char* option )
default:
- return FALSE;
+ found = FALSE;
}
@@ -1277,3 +1288,3 @@ bool VCLinkerTool::parseOption( const char* option )
default:
- return FALSE;
+ found = FALSE;
}
@@ -1326,3 +1337,3 @@ bool VCLinkerTool::parseOption( const char* option )
default:
- return FALSE;
+ found = FALSE;
}
@@ -1336,3 +1347,3 @@ bool VCLinkerTool::parseOption( const char* option )
else
- return FALSE;
+ found = FALSE;
break;
@@ -1362,5 +1373,7 @@ bool VCLinkerTool::parseOption( const char* option )
default:
- return FALSE;
+ found = FALSE;
}
- return TRUE;
+ if( !found )
+ warn_msg( WarnLogic, "Could not parse Linker options: %s", option );
+ return found;
}
@@ -1394,3 +1407,3 @@ QTextStream &operator<<( QTextStream &strm, const VCMIDLTool &tool )
strm << XPair( _AdditionalIncludeDirectories, tool.AdditionalIncludeDirectories );
- strm << XPair( _AdditionalOptions, tool.AdditionalOptions );
+ strm << XPair( _AdditionalOptions, tool.AdditionalOptions, " " );
strm << XPair( _CPreprocessOptions, tool.CPreprocessOptions );
@@ -1429,3 +1442,3 @@ bool VCMIDLTool::parseOption( const char* option )
{
-#if 0
+#ifdef USE_DISPLAY_HASH
displayHash( "/D name[=def]" ); displayHash( "/I directory-list" ); displayHash( "/Oi" );
@@ -1457,2 +1470,3 @@ bool VCMIDLTool::parseOption( const char* option )
#endif
+ bool found = TRUE;
int offset = 0;
@@ -1492,3 +1506,3 @@ bool VCMIDLTool::parseOption( const char* option )
default:
- return FALSE;
+ found = FALSE;
}
@@ -1507,3 +1521,3 @@ bool VCMIDLTool::parseOption( const char* option )
default:
- return FALSE;
+ found = FALSE;
}
@@ -1538,9 +1552,9 @@ bool VCMIDLTool::parseOption( const char* option )
case 'r':
- break;
ErrorCheckRefPointers = _True;
- case 's':
break;
+ case 's':
ErrorCheckStubData = _True;
+ break;
default:
- return FALSE;
+ found = FALSE;
}
@@ -1649,3 +1663,3 @@ bool VCMIDLTool::parseOption( const char* option )
default:
- return FALSE;
+ found = FALSE;
}
@@ -1654,2 +1668,4 @@ bool VCMIDLTool::parseOption( const char* option )
}
+ if( !found )
+ warn_msg( WarnLogic, "Could not parse MIDL option: %s", option );
return TRUE;
@@ -1670,3 +1686,3 @@ QTextStream &operator<<( QTextStream &strm, const VCLibrarianTool &tool )
strm << XPair( _AdditionalLibraryDirectories, tool.AdditionalLibraryDirectories );
- strm << XPair( _AdditionalOptions, tool.AdditionalOptions );
+ strm << XPair( _AdditionalOptions, tool.AdditionalOptions, " " );
strm << XPair( _ExportNamedFunctions, tool.ExportNamedFunctions );
@@ -1716,3 +1732,3 @@ QTextStream &operator<<( QTextStream &strm, const VCResourceCompilerTool &tool )
strm << XPair( _AdditionalIncludeDirectories, tool.AdditionalIncludeDirectories );
- strm << XPair( _AdditionalOptions, tool.AdditionalOptions );
+ strm << XPair( _AdditionalOptions, tool.AdditionalOptions, " " );
if ( tool.Culture != rcUseDefault ) strm << EPair( _Culture, tool.Culture );
@@ -1853,8 +1869,29 @@ void VCFilter::generateUIC( QTextStream &strm, const QString& str ) const
QString mocDir = Project->var( "MOC_DIR" );
- int dot = fname.findRev( '.' );
- if( dot != -1 )
- fname.truncate( dot );
+ QString uiDir = Project->var( "UI_DIR" );
+ QString uiHeaders;
+ QString uiSources;
+ // Determining the paths for the output files.
int slash = str.findRev( '\\' );
QString pname = ( slash != -1 ) ? str.left( slash+1 ) : QString(".\\");
+ if( !uiDir.isEmpty() ) {
+ uiHeaders = uiDir;
+ uiSources = uiDir;
+ } else {
+ uiHeaders = Project->var( "UI_HEADERS_DIR" );
+ uiSources = Project->var( "UI_SOURCES_DIR" );
+ if( uiHeaders.isEmpty() )
+ uiHeaders = pname;
+ if( uiSources.isEmpty() )
+ uiSources = pname;
+ }
+ if( !uiHeaders.endsWith( "\\" ) )
+ uiHeaders += "\\";
+ if( !uiSources.endsWith( "\\" ) )
+ uiSources += "\\";
+
+ // Determine the file name.
+ int dot = fname.findRev( '.' );
+ if( dot != -1 )
+ fname.truncate( dot );
@@ -1869,5 +1906,5 @@ void VCFilter::generateUIC( QTextStream &strm, const QString& str ) const
strm << _CommandLine6;
- strm << uicApp << " " << str << " -o " << pname << fname << ".h &amp;&amp; "; // Create .h from .ui file
- strm << uicApp << " " << str << " -i " << fname << ".h -o " << pname << fname << ".cpp &amp;&amp; "; // Create .cpp from .ui file
- strm << mocApp << " " << pname << fname << ".h -o " << mocDir << "moc_" << fname << ".cpp\"";
+ strm << uicApp << " " << str << " -o " << uiHeaders << fname << ".h &amp;&amp; "; // Create .h from .ui file
+ strm << uicApp << " " << str << " -i " << fname << ".h -o " << uiSources << fname << ".cpp &amp;&amp; "; // Create .cpp from .ui file
+ strm << mocApp << " " << uiHeaders << fname << ".h -o " << mocDir << "moc_" << fname << ".cpp\"";
strm << _AdditionalDependencies6;
@@ -1875,3 +1912,3 @@ void VCFilter::generateUIC( QTextStream &strm, const QString& str ) const
strm << _Outputs6;
- strm << pname << fname << ".h;" << pname << fname << ".cpp;" << mocDir << "moc_" << fname << ".cpp\"";
+ strm << uiHeaders << fname << ".h;" << uiSources << fname << ".cpp;" << mocDir << "moc_" << fname << ".cpp\"";
strm << "/>";
@@ -1908,5 +1945,5 @@ VCProject::VCProject()
{
- QUuid uniqueId;
#if defined(Q_WS_WIN32)
GUID guid;
+ QUuid uniqueId;
HRESULT h = CoCreateGuid( &guid );