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
@@ -384,5 +384,5 @@ QTextStream &operator<<( QTextStream &strm, const VCCLCompilerTool &tool )
strm << _VCCLCompilerToolName;
strm << XPair( _AdditionalIncludeDirectories, tool.AdditionalIncludeDirectories );
- strm << XPair( _AdditionalOptions, tool.AdditionalOptions );
+ strm << XPair( _AdditionalOptions, tool.AdditionalOptions, " " );
strm << XPair( _AdditionalUsingDirectories, tool.AdditionalUsingDirectories );
strm << SPair( _AssemblerListingLocation, tool.AssemblerListingLocation );
@@ -455,4 +455,5 @@ bool VCCLCompilerTool::parseOption( const char* option )
char third = option[3];
char fourth = option[4];
+ bool found = TRUE;
switch ( first ) {
@@ -460,15 +461,18 @@ bool VCCLCompilerTool::parseOption( const char* option )
case 'h':
qWarning( "Generator: Option '/?', '/help': MSVC.NET projects do not support outputting help info" );
- return FALSE;
+ found = FALSE;
+ break;
case '@':
qWarning( "Generator: Option '/@': MSVC.NET projects do not support the use of a response file" );
- return FALSE;
+ found = FALSE;
+ break;
case 'l':
qWarning( "Generator: Option '/link': qmake generator does not support passing link options through the compiler tool" );
- return FALSE;
-
+ found = FALSE;
+ break;
case 'A':
- if ( second != 'I' )
- return FALSE;
+ if ( second != 'I' ) {
+ found = FALSE; break;
+ }
AdditionalUsingDirectories += option+2;
break;
@@ -488,5 +492,5 @@ bool VCCLCompilerTool::parseOption( const char* option )
break;
}
- return FALSE;
+ found = FALSE; break;
}
GeneratePreprocessedFile = preprocessYes;
@@ -545,5 +549,5 @@ bool VCCLCompilerTool::parseOption( const char* option )
break;
default:
- return FALSE;
+ found = FALSE; break;
}
}
@@ -554,5 +558,5 @@ bool VCCLCompilerTool::parseOption( const char* option )
case '4':
qWarning( "Option '/G3' and '/G4' were phased out in Visual C++ 5.0" );
- return FALSE;
+ found = FALSE; break;
case '5':
OptimizeForProcessor = procOptimizePentium;
@@ -620,5 +624,5 @@ bool VCCLCompilerTool::parseOption( const char* option )
break;
default:
- return FALSE;
+ found = FALSE; break;
}
break;
@@ -634,5 +638,5 @@ bool VCCLCompilerTool::parseOption( const char* option )
break;
}
- return FALSE;
+ found = FALSE; break;
case 'M':
if ( second == 'D' ) {
@@ -652,5 +656,5 @@ bool VCCLCompilerTool::parseOption( const char* option )
break;
}
- return FALSE;
+ found = FALSE; break;
case 'O':
switch ( second ) {
@@ -672,5 +676,5 @@ bool VCCLCompilerTool::parseOption( const char* option )
InlineFunctionExpansion = expandAnySuitable;
else
- return FALSE;
+ found = FALSE;
break;
case 'd':
@@ -706,5 +710,5 @@ bool VCCLCompilerTool::parseOption( const char* option )
break;
default:
- return FALSE;
+ found = FALSE; break;
}
break;
@@ -717,5 +721,5 @@ bool VCCLCompilerTool::parseOption( const char* option )
break;
}
- return FALSE;
+ found = FALSE; break;
case 'R':
if ( second == 'T' && third == 'C' ) {
@@ -729,5 +733,5 @@ bool VCCLCompilerTool::parseOption( const char* option )
BasicRuntimeChecks = runtimeCheckUninitVariables;
else
- return FALSE;
+ found = FALSE; break;
}
break;
@@ -739,5 +743,5 @@ bool VCCLCompilerTool::parseOption( const char* option )
} else {
qWarning( "Generator: Options '/Tp<filename>' and '/Tc<filename>' are not supported by qmake" );
- return FALSE;
+ found = FALSE; break;
}
break;
@@ -779,5 +783,5 @@ bool VCCLCompilerTool::parseOption( const char* option )
// Fallthrough
default:
- return FALSE;
+ found = FALSE; break;
}
break;
@@ -808,5 +812,5 @@ bool VCCLCompilerTool::parseOption( const char* option )
break;
default:
- return FALSE;
+ found = FALSE; break;
}
break;
@@ -841,7 +845,7 @@ bool VCCLCompilerTool::parseOption( const char* option )
TreatWChar_tAsBuiltInType = _True;
else
- return FALSE;
+ found = FALSE;
} else {
- return FALSE;
+ found = FALSE; break;
}
break;
@@ -870,9 +874,9 @@ bool VCCLCompilerTool::parseOption( const char* option )
break;
default:
- return FALSE;
+ found = FALSE; break;
}
break;
default:
- return FALSE;
+ found = FALSE; break;
}
break;
@@ -888,10 +892,11 @@ bool VCCLCompilerTool::parseOption( const char* option )
}
} else {
- return FALSE;
+ found = FALSE; break;
}
break;
case 'd':
- if ( second != 'r' )
- return FALSE;
+ if ( second != 'r' ) {
+ found = FALSE; break;
+ }
CompileAsManaged = managedAssembly;
break;
@@ -905,5 +910,5 @@ bool VCCLCompilerTool::parseOption( const char* option )
break;
}
- return FALSE;
+ found = FALSE; break;
case 's':
if ( second == 'h' && third == 'o' && fourth == 'w' ) {
@@ -911,5 +916,5 @@ bool VCCLCompilerTool::parseOption( const char* option )
break;
}
- return FALSE;
+ found = FALSE; break;
case 'u':
UndefineAllPreprocessorDefinitions = _True;
@@ -920,5 +925,5 @@ bool VCCLCompilerTool::parseOption( const char* option )
break;
}
- return FALSE;
+ found = FALSE; break;
case 'w':
switch ( second ) {
@@ -934,6 +939,8 @@ bool VCCLCompilerTool::parseOption( const char* option )
break;
default:
- return FALSE;
+ found = FALSE; break;
}
+ if( !found )
+ warn_msg( WarnLogic, "Could not parse Compiler option: %s", option );
return TRUE;
}
@@ -981,5 +988,5 @@ QTextStream &operator<<( QTextStream &strm, const VCLinkerTool &tool )
strm << XPair( _AdditionalDependencies4, tool.AdditionalDependencies, " " );
strm << XPair( _AdditionalLibraryDirectories, tool.AdditionalLibraryDirectories );
- strm << XPair( _AdditionalOptions, tool.AdditionalOptions );
+ strm << XPair( _AdditionalOptions, tool.AdditionalOptions, " " );
strm << XPair( _AddModuleNamesToAssembly, tool.AddModuleNamesToAssembly );
strm << SPair( _BaseAddress, tool.BaseAddress );
@@ -1061,12 +1068,16 @@ static uint elfHash( const char* name )
return h;
}
+
+//#define USE_DISPLAY_HASH
+#ifdef USE_DISPLAY_HASH
static void displayHash( const char* str )
{
printf( "case 0x%07x: // %s\n break;\n", elfHash(str), str );
}
+#endif
bool VCLinkerTool::parseOption( const char* option )
{
-#if 0
+#ifdef USE_DISPLAY_HASH
// Main options
displayHash( "/ALIGN" ); displayHash( "/ALLOWBIND" ); displayHash( "/ASSEMBLYMODULE" );
@@ -1089,5 +1100,5 @@ bool VCLinkerTool::parseOption( const char* option )
displayHash( "/VXD" ); displayHash( "/WS " );
#endif
-#if 0
+#ifdef USE_DISPLAY_HASH
// Sub options
displayHash( "UNLOAD" ); displayHash( "NOBIND" ); displayHash( "no" ); displayHash( "NOSTATUS" ); displayHash( "STATUS" );
@@ -1099,5 +1110,5 @@ bool VCLinkerTool::parseOption( const char* option )
displayHash( "POSIX" ); displayHash( "WINDOWS" ); displayHash( "WINDOWSCE" ); displayHash( "NET" ); displayHash( "CD" ); displayHash( "NO" );
#endif
-
+ bool found = TRUE;
switch ( elfHash(option) ) {
case 0x3360dbe: // /ALIGN[:number]
@@ -1217,5 +1228,5 @@ bool VCLinkerTool::parseOption( const char* option )
break;
default:
- return FALSE;
+ found = FALSE;
}
break;
@@ -1276,5 +1287,5 @@ bool VCLinkerTool::parseOption( const char* option )
break;
default:
- return FALSE;
+ found = FALSE;
}
}
@@ -1325,5 +1336,5 @@ bool VCLinkerTool::parseOption( const char* option )
break;
default:
- return FALSE;
+ found = FALSE;
}
}
@@ -1335,5 +1346,5 @@ bool VCLinkerTool::parseOption( const char* option )
SwapRunFromCD = _True;
else
- return FALSE;
+ found = FALSE;
break;
case 0x34906d4: // /TLBID:id
@@ -1361,7 +1372,9 @@ bool VCLinkerTool::parseOption( const char* option )
break;
default:
- return FALSE;
+ found = FALSE;
}
- return TRUE;
+ if( !found )
+ warn_msg( WarnLogic, "Could not parse Linker options: %s", option );
+ return found;
}
@@ -1393,5 +1406,5 @@ QTextStream &operator<<( QTextStream &strm, const VCMIDLTool &tool )
strm << _VCMIDLToolName;
strm << XPair( _AdditionalIncludeDirectories, tool.AdditionalIncludeDirectories );
- strm << XPair( _AdditionalOptions, tool.AdditionalOptions );
+ strm << XPair( _AdditionalOptions, tool.AdditionalOptions, " " );
strm << XPair( _CPreprocessOptions, tool.CPreprocessOptions );
strm << EPair( _DefaultCharType, tool.DefaultCharType );
@@ -1428,5 +1441,5 @@ QTextStream &operator<<( QTextStream &strm, const VCMIDLTool &tool )
bool VCMIDLTool::parseOption( const char* option )
{
-#if 0
+#ifdef USE_DISPLAY_HASH
displayHash( "/D name[=def]" ); displayHash( "/I directory-list" ); displayHash( "/Oi" );
displayHash( "/Oic" ); displayHash( "/Oicf" ); displayHash( "/Oif" ); displayHash( "/Os" );
@@ -1456,4 +1469,5 @@ bool VCMIDLTool::parseOption( const char* option )
displayHash( "/win32" ); displayHash( "/win64" );
#endif
+ bool found = TRUE;
int offset = 0;
switch( elfHash(option) ) {
@@ -1491,5 +1505,5 @@ bool VCMIDLTool::parseOption( const char* option )
break;
default:
- return FALSE;
+ found = FALSE;
}
break;
@@ -1506,5 +1520,5 @@ bool VCMIDLTool::parseOption( const char* option )
break;
default:
- return FALSE;
+ found = FALSE;
}
break;
@@ -1537,11 +1551,11 @@ bool VCMIDLTool::parseOption( const char* option )
break;
case 'r':
- break;
ErrorCheckRefPointers = _True;
- case 's':
break;
+ case 's':
ErrorCheckStubData = _True;
+ break;
default:
- return FALSE;
+ found = FALSE;
}
break;
@@ -1648,9 +1662,11 @@ bool VCMIDLTool::parseOption( const char* option )
break;
default:
- return FALSE;
+ found = FALSE;
}
}
break;
}
+ if( !found )
+ warn_msg( WarnLogic, "Could not parse MIDL option: %s", option );
return TRUE;
}
@@ -1669,5 +1685,5 @@ QTextStream &operator<<( QTextStream &strm, const VCLibrarianTool &tool )
strm << XPair( _AdditionalDependencies4, tool.AdditionalDependencies );
strm << XPair( _AdditionalLibraryDirectories, tool.AdditionalLibraryDirectories );
- strm << XPair( _AdditionalOptions, tool.AdditionalOptions );
+ strm << XPair( _AdditionalOptions, tool.AdditionalOptions, " " );
strm << XPair( _ExportNamedFunctions, tool.ExportNamedFunctions );
strm << XPair( _ForceSymbolReferences, tool.ForceSymbolReferences );
@@ -1715,5 +1731,5 @@ QTextStream &operator<<( QTextStream &strm, const VCResourceCompilerTool &tool )
strm << SPair( _ToolPath, tool.ToolPath );
strm << XPair( _AdditionalIncludeDirectories, tool.AdditionalIncludeDirectories );
- strm << XPair( _AdditionalOptions, tool.AdditionalOptions );
+ strm << XPair( _AdditionalOptions, tool.AdditionalOptions, " " );
if ( tool.Culture != rcUseDefault ) strm << EPair( _Culture, tool.Culture );
strm << XPair( _FullIncludePath, tool.FullIncludePath );
@@ -1852,10 +1868,31 @@ void VCFilter::generateUIC( QTextStream &strm, const QString& str ) const
QString fname = str.section( '\\', -1 );
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 );
strm << _begFileConfiguration;
@@ -1868,11 +1905,11 @@ void VCFilter::generateUIC( QTextStream &strm, const QString& str ) const
strm << "Uic'ing " << str << "...\"";
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;
strm << mocApp << ";" << uicApp << "\"";
strm << _Outputs6;
- strm << pname << fname << ".h;" << pname << fname << ".cpp;" << mocDir << "moc_" << fname << ".cpp\"";
+ strm << uiHeaders << fname << ".h;" << uiSources << fname << ".cpp;" << mocDir << "moc_" << fname << ".cpp\"";
strm << "/>";
strm << _endFileConfiguration;
@@ -1907,7 +1944,7 @@ QTextStream &operator<<( QTextStream &strm, const VCFilter &tool )
VCProject::VCProject()
{
- QUuid uniqueId;
#if defined(Q_WS_WIN32)
GUID guid;
+ QUuid uniqueId;
HRESULT h = CoCreateGuid( &guid );
if ( h == S_OK )