[Scummvm-cvs-logs] SF.net SVN: scummvm:[51213] scummvm/trunk/tools/create_msvc/create_msvc.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Fri Jul 23 20:42:54 CEST 2010


Revision: 51213
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51213&view=rev
Author:   lordhoto
Date:     2010-07-23 18:42:54 +0000 (Fri, 23 Jul 2010)

Log Message:
-----------
TOOLS: Fix MSVC 2010 project files.

Formerly the MSVC 2010 project files did not respect the global include/library/executable directories of the user, but used custom paths for that. This resulted in headers and libraries not be found by the MSVC, in case they were not stored in %(SCUMMVM_LIBS).

Additionally it overwrote the executable MSVC used when compiling for x64, thus breaking the x64 target.

Modified Paths:
--------------
    scummvm/trunk/tools/create_msvc/create_msvc.cpp

Modified: scummvm/trunk/tools/create_msvc/create_msvc.cpp
===================================================================
--- scummvm/trunk/tools/create_msvc/create_msvc.cpp	2010-07-23 16:38:31 UTC (rev 51212)
+++ scummvm/trunk/tools/create_msvc/create_msvc.cpp	2010-07-23 18:42:54 UTC (rev 51213)
@@ -210,8 +210,9 @@
 	 * @param bits Number of bits the platform supports.
 	 * @param defines Defines the platform needs to have set.
 	 * @param prefix File prefix, used to add additional include paths.
+	 * @param isWin32 Bitness of property file
 	 */
-	virtual void outputGlobalPropFile(std::ofstream &properties, int bits, const std::string &defines, const std::string &prefix) = 0;
+	virtual void outputGlobalPropFile(std::ofstream &properties, int bits, const std::string &defines, const std::string &prefix, bool isWin32) = 0;
 
 	/**
 	 * Generates the project properties for debug and release settings.
@@ -282,7 +283,7 @@
 
 	void writeReferences(std::ofstream &output);
 
-	void outputGlobalPropFile(std::ofstream &properties, int bits, const std::string &defines, const std::string &prefix);
+	void outputGlobalPropFile(std::ofstream &properties, int bits, const std::string &defines, const std::string &prefix, bool isWin32);
 
 	void createBuildProp(const BuildSetup &setup, bool isRelease, bool isWin32);
 
@@ -305,7 +306,7 @@
 
 	void writeReferences(std::ofstream &output);
 
-	void outputGlobalPropFile(std::ofstream &properties, int bits, const std::string &defines, const std::string &prefix);
+	void outputGlobalPropFile(std::ofstream &properties, int bits, const std::string &defines, const std::string &prefix, bool isWin32);
 
 	void createBuildProp(const BuildSetup &setup, bool isRelease, bool isWin32);
 
@@ -1326,7 +1327,7 @@
 		defines += *i;
 	}
 
-	outputGlobalPropFile(properties, 32, defines, convertPathToWin(setup.filePrefix));
+	outputGlobalPropFile(properties, 32, defines, convertPathToWin(setup.filePrefix), true);
 	properties.close();
 
 	properties.open((setup.outputDir + '/' + "ScummVM_Global64" + getPropertiesExtension()).c_str());
@@ -1348,7 +1349,7 @@
 		defines += *i;
 	}
 
-	outputGlobalPropFile(properties, 64, defines, convertPathToWin(setup.filePrefix));
+	outputGlobalPropFile(properties, 64, defines, convertPathToWin(setup.filePrefix), false);
 }
 
 void ProjectProvider::addFilesToProject(const std::string &dir, std::ofstream &projectFile,
@@ -1651,7 +1652,7 @@
 	output << "\tEndProjectSection\n";
 }
 
-void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int bits, const std::string &defines, const std::string &prefix) {
+void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int bits, const std::string &defines, const std::string &prefix, bool isWin32) {
 	properties << "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n"
 	              "<VisualStudioPropertySheet\n"
 	              "\tProjectType=\"Visual C++\"\n"
@@ -1899,12 +1900,6 @@
 	// Project version number
 	project << "\t<PropertyGroup>\n"
 	           "\t\t<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n";
-
-	if (name == "scummvm")
-		project << "<ExecutablePath>$(SCUMMVM_LIBS)\\bin;$(VCInstallDir)bin;$(WindowsSdkDir)bin\\NETFX 4.0 Tools;$(WindowsSdkDir)bin;$(VSInstallDir)Common7\\Tools\\bin;$(VSInstallDir)Common7\\tools;$(VSInstallDir)Common7\\ide;$(ProgramFiles)\\HTML Help Workshop;$(FrameworkSDKDir)\\bin;$(MSBuildToolsPath32);$(VSInstallDir);$(SystemRoot)\\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>\n"
-		           "<IncludePath>$(SCUMMVM_LIBS)\\include;$(VCInstallDir)include;$(VCInstallDir)atlmfc\\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\\include;</IncludePath>\n"
-		           "<LibraryPath>$(SCUMMVM_LIBS)\\lib;$(VCInstallDir)lib;$(VCInstallDir)atlmfc\\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\\lib</LibraryPath>\n";
-
 	project << "\t</PropertyGroup>\n";
 
 	// Project-specific settings
@@ -2049,38 +2044,41 @@
 	project << "\t</ItemDefinitionGroup>\n";
 }
 
-void MSBuildProvider::outputGlobalPropFile(std::ofstream &properties, int bits, const std::string &defines, const std::string &prefix) {	
+void MSBuildProvider::outputGlobalPropFile(std::ofstream &properties, int bits, const std::string &defines, const std::string &prefix, bool isWin32) {	
 	properties << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
 	              "<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n"
-	              "<PropertyGroup>\n"
-	              "<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n"
-	              "<_PropertySheetDisplayName>ScummVM_Global</_PropertySheetDisplayName>\n"
-	              "<OutDir>$(Configuration)" << bits << "\\</OutDir>\n"
-	              "<IntDir>$(Configuration)" << bits << "/$(ProjectName)\\</IntDir>\n"
-	              "</PropertyGroup>\n"
-	              "<ItemDefinitionGroup>\n"
-	              "<ClCompile>\n"
-	              "<DisableLanguageExtensions>true</DisableLanguageExtensions>\n"
-	              "<DisableSpecificWarnings>" << _globalWarnings << ";%(DisableSpecificWarnings)</DisableSpecificWarnings>\n"
-	              "<AdditionalIncludeDirectories>" << prefix << ";" << prefix << "\\engines;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n"
-	              "<PreprocessorDefinitions>" << defines << ";%(PreprocessorDefinitions)</PreprocessorDefinitions>\n"
-	              "<ExceptionHandling>\n"
-	              "</ExceptionHandling>\n"
-	              "<RuntimeTypeInfo>false</RuntimeTypeInfo>\n"
-	              "<WarningLevel>Level4</WarningLevel>\n"
-	              "<TreatWarningAsError>false</TreatWarningAsError>\n"
-	              "<CompileAs>Default</CompileAs>\n"
-	              "</ClCompile>\n"
-	              "<Link>\n"
-	              "<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>\n"
-	              "<SubSystem>Console</SubSystem>\n"
-	              "<EntryPointSymbol>WinMainCRTStartup</EntryPointSymbol>\n"
-	              "</Link>\n"
-	              "<ResourceCompile>\n"
-	              "<PreprocessorDefinitions>HAS_INCLUDE_SET;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n"
-	              "<AdditionalIncludeDirectories>" << prefix << ";%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n"
-	              "</ResourceCompile>\n"
-	              "</ItemDefinitionGroup>\n"
+	              "\t<PropertyGroup>\n"
+	              "\t\t<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n"
+	              "\t\t<_PropertySheetDisplayName>ScummVM_Global</_PropertySheetDisplayName>\n"
+	              "\t\t<ExecutablePath>%(SCUMMVM_LIBS)\\bin;$(ExecutablePath)</ExecutablePath>\n"
+	              "\t\t<LibraryPath>%(SCUMMVM_LIBS)\\libs\\" << (isWin32 ? "x86" : "x64") << ";$(LibraryPath)</LibraryPath>\n"
+				  "\t\t<IncludePath>%(SCUMMVM_LIBS)\\include;$(IncludePath)</IncludePath>\n"
+	              "\t\t<OutDir>$(Configuration)" << bits << "\\</OutDir>\n"
+	              "\t\t<IntDir>$(Configuration)" << bits << "/$(ProjectName)\\</IntDir>\n"
+	              "\t</PropertyGroup>\n"
+	              "\t<ItemDefinitionGroup>\n"
+	              "\t\t<ClCompile>\n"
+	              "\t\t\t<DisableLanguageExtensions>true</DisableLanguageExtensions>\n"
+	              "\t\t\t<DisableSpecificWarnings>" << _globalWarnings << ";%(DisableSpecificWarnings)</DisableSpecificWarnings>\n"
+	              "\t\t\t<AdditionalIncludeDirectories>" << prefix << ";" << prefix << "\\engines;$(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n"
+	              "\t\t\t<PreprocessorDefinitions>" << defines << ";%(PreprocessorDefinitions)</PreprocessorDefinitions>\n"
+	              "\t\t\t<ExceptionHandling>\n"
+	              "\t\t\t</ExceptionHandling>\n"
+	              "\t\t\t<RuntimeTypeInfo>false</RuntimeTypeInfo>\n"
+	              "\t\t\t<WarningLevel>Level4</WarningLevel>\n"
+	              "\t\t\t<TreatWarningAsError>false</TreatWarningAsError>\n"
+	              "\t\t\t<CompileAs>Default</CompileAs>\n"
+	              "\t\t</ClCompile>\n"
+	              "\t\t<Link>\n"
+	              "\t\t\t<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>\n"
+	              "\t\t\t<SubSystem>Console</SubSystem>\n"
+	              "\t\t\t<EntryPointSymbol>WinMainCRTStartup</EntryPointSymbol>\n"
+	              "\t\t</Link>\n"
+	              "\t\t<ResourceCompile>\n"
+	              "\t\t\t<PreprocessorDefinitions>HAS_INCLUDE_SET;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n"
+	              "\t\t\t<AdditionalIncludeDirectories>" << prefix << ";%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n"
+	              "\t\t</ResourceCompile>\n"
+	              "\t</ItemDefinitionGroup>\n"
 	              "</Project>\n";
 
 	properties.flush();
@@ -2105,8 +2103,10 @@
 	              "\t\t<LinkIncremental>" << (isRelease ? "false" : "true") << "</LinkIncremental>\n"
 	              "\t</PropertyGroup>\n"
 	              "\t<ItemDefinitionGroup>\n"
-	              "\t\t<ClCompile>\n";
+				  "\t\t<ClCompile>\n";
 
+
+
 	if (isRelease) {
 		properties << "\t\t\t<IntrinsicFunctions>true</IntrinsicFunctions>\n"
 		              "\t\t\t<WholeProgramOptimization>true</WholeProgramOptimization>\n"


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list