From 4ab35ccfe9f50629ce69732d52ebe69037e6cd23 Mon Sep 17 00:00:00 2001 From: lordmulder Date: Thu, 11 Nov 2010 00:25:23 +0100 Subject: [PATCH] Add a new configuration for static build (requires Qt as static lib) --- LameXP.sln | 3 + LameXP.vcproj | 263 ++++++++++++++++++++++++++++++ etc/Deployment/_build.bat | 6 +- etc/Deployment/_deploy.bat | 95 +++++++++++ etc/Deployment/debug.bat | 4 +- etc/Deployment/release.bat | 89 +--------- etc/Deployment/release_static.bat | 3 + src/Global.cpp | 13 +- 8 files changed, 383 insertions(+), 93 deletions(-) create mode 100644 etc/Deployment/_deploy.bat create mode 100644 etc/Deployment/release_static.bat diff --git a/LameXP.sln b/LameXP.sln index 923e5e5a..74220623 100644 --- a/LameXP.sln +++ b/LameXP.sln @@ -6,11 +6,14 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 + Release Static|Win32 = Release Static|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {00FE736A-8DB1-41B3-B915-4CD8DB09EF48}.Debug|Win32.ActiveCfg = Debug|Win32 {00FE736A-8DB1-41B3-B915-4CD8DB09EF48}.Debug|Win32.Build.0 = Debug|Win32 + {00FE736A-8DB1-41B3-B915-4CD8DB09EF48}.Release Static|Win32.ActiveCfg = Release Static|Win32 + {00FE736A-8DB1-41B3-B915-4CD8DB09EF48}.Release Static|Win32.Build.0 = Release Static|Win32 {00FE736A-8DB1-41B3-B915-4CD8DB09EF48}.Release|Win32.ActiveCfg = Release|Win32 {00FE736A-8DB1-41B3-B915-4CD8DB09EF48}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection diff --git a/LameXP.vcproj b/LameXP.vcproj index e3c14ce1..f93b9079 100644 --- a/LameXP.vcproj +++ b/LameXP.vcproj @@ -102,6 +102,7 @@ IntermediateDirectory="$(SolutionDir)obj\$(ConfigurationName)" ConfigurationType="1" CharacterSet="1" + WholeProgramOptimization="1" > + + + + + + + + + + + + + + + + + + + @@ -288,6 +381,16 @@ Outputs=""$(SolutionDir)tmp\MOC_$(SafeInputName).cpp"" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #endif //_DEBUG +//Disable nasty warning +#ifndef QT_DLL +#pragma warning(disable:4101) +#endif + /////////////////////////////////////////////////////////////////////////////// // TYPES /////////////////////////////////////////////////////////////////////////////// @@ -241,9 +246,15 @@ bool lamexp_init_qt(int argc, char* argv[]) QCoreApplication::setLibraryPaths(QStringList() << QApplication::applicationDirPath()); qDebug("Library Path:\n%s\n", QApplication::libraryPaths().first().toUtf8().constData()); + //Initialize static Qt plugins + #ifndef QT_DLL + Q_IMPORT_PLUGIN(qsvg); + Q_IMPORT_PLUGIN(qico); + #endif + //Check for supported image formats QList supportedFormats = QImageReader::supportedImageFormats(); - if(!(supportedFormats.contains("png") && supportedFormats.contains("gif") && supportedFormats.contains("ico") && supportedFormats.contains("svg"))) + if(!(supportedFormats.contains("png") && supportedFormats.contains("gif") && supportedFormats.contains("ico") && supportedFormats.contains("svg"))) { qFatal("Qt initialization error: At least one image format plugin is missing!"); return false;