mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-05 01:38:36 +00:00
updated create_project tool for residual, but not tested yet
This commit is contained in:
parent
251d332674
commit
f5e687ac0e
@ -34,20 +34,20 @@ CodeBlocksProvider::CodeBlocksProvider(StringList &global_warnings, std::map<std
|
||||
}
|
||||
|
||||
void CodeBlocksProvider::createWorkspace(const BuildSetup &setup) {
|
||||
std::ofstream workspace((setup.outputDir + '/' + "scummvm.workspace").c_str());
|
||||
std::ofstream workspace((setup.outputDir + '/' + "residul.workspace").c_str());
|
||||
if (!workspace)
|
||||
error("Could not open \"" + setup.outputDir + '/' + "scummvm.workspace\" for writing");
|
||||
error("Could not open \"" + setup.outputDir + '/' + "residual.workspace\" for writing");
|
||||
|
||||
workspace << "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n"
|
||||
"<CodeBlocks_workspace_file>\n";
|
||||
|
||||
workspace << "\t<Workspace title=\"ScummVM\">\n";
|
||||
workspace << "\t<Workspace title=\"Residual\">\n";
|
||||
|
||||
writeReferences(workspace);
|
||||
|
||||
// Note we assume that the UUID map only includes UUIDs for enabled engines!
|
||||
for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
|
||||
if (i->first == "scummvm")
|
||||
if (i->first == "residual")
|
||||
continue;
|
||||
|
||||
workspace << "\t\t<Project filename=\"" << i->first << ".cbp\" />\n";
|
||||
@ -90,16 +90,16 @@ void CodeBlocksProvider::createProjectFile(const std::string &name, const std::s
|
||||
"\t\t<Option compiler=\"gcc\" />\n"
|
||||
"\t\t<Build>\n";
|
||||
|
||||
if (name == "scummvm") {
|
||||
if (name == "residual") {
|
||||
std::string libraries;
|
||||
|
||||
for (StringList::const_iterator i = setup.libraries.begin(); i != setup.libraries.end(); ++i)
|
||||
libraries += processLibraryName(*i) + ".a;";
|
||||
|
||||
project << "\t\t\t<Target title=\"default\">\n"
|
||||
"\t\t\t\t<Option output=\"scummvm\\scummvm\" prefix_auto=\"1\" extension_auto=\"1\" />\n"
|
||||
"\t\t\t\t<Option object_output=\"scummvm\" />\n"
|
||||
"\t\t\t\t<Option external_deps=\"" << libraries /* + list of engines scummvm\engines\name\name.a */ << "\" />\n"
|
||||
"\t\t\t\t<Option output=\"residual\\residual\" prefix_auto=\"1\" extension_auto=\"1\" />\n"
|
||||
"\t\t\t\t<Option object_output=\"residual\" />\n"
|
||||
"\t\t\t\t<Option external_deps=\"" << libraries /* + list of engines residual\engines\name\name.a */ << "\" />\n"
|
||||
"\t\t\t\t<Option type=\"1\" />\n"
|
||||
"\t\t\t\t<Option compiler=\"gcc\" />\n"
|
||||
"\t\t\t\t<Option parameters=\"-d 8 --debugflags=parser\" />\n"
|
||||
@ -112,8 +112,8 @@ void CodeBlocksProvider::createProjectFile(const std::string &name, const std::s
|
||||
writeWarnings(name, project);
|
||||
writeDefines(setup.defines, project);
|
||||
|
||||
project << "\t\t\t\t\t<Add directory=\"$(SCUMMVM_LIBS)include\" />\n"
|
||||
"\t\t\t\t\t<Add directory=\"$(SCUMMVM_LIBS)include\\SDL\" />\n"
|
||||
project << "\t\t\t\t\t<Add directory=\"$(RESIDUAL_LIBS)include\" />\n"
|
||||
"\t\t\t\t\t<Add directory=\"$(RESIDUAL_LIBS)include\\SDL\" />\n"
|
||||
"\t\t\t\t\t<Add directory=\"..\\..\\engines\" />\n"
|
||||
"\t\t\t\t\t<Add directory=\"..\\..\\common\" />\n"
|
||||
"\t\t\t\t\t<Add directory=\"..\\..\" />\n"
|
||||
@ -127,21 +127,21 @@ void CodeBlocksProvider::createProjectFile(const std::string &name, const std::s
|
||||
project << "\t\t\t\t\t<Add library=\"" << processLibraryName(*i) << "\" />\n";
|
||||
|
||||
for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
|
||||
if (i->first == "scummvm")
|
||||
if (i->first == "residual")
|
||||
continue;
|
||||
|
||||
project << "\t\t\t\t\t<Add library=\"scummvm\\engines\\" << i->first << "\\lib" << i->first << ".a\" />\n";
|
||||
project << "\t\t\t\t\t<Add library=\"residual\\engines\\" << i->first << "\\lib" << i->first << ".a\" />\n";
|
||||
}
|
||||
|
||||
project << "\t\t\t\t\t<Add directory=\"$(SCUMMVM_LIBS)lib\\mingw\" />\n"
|
||||
"\t\t\t\t\t<Add directory=\"$(SCUMMVM_LIBS)lib\" />\n"
|
||||
project << "\t\t\t\t\t<Add directory=\"$(RESIDUAL_LIBS)lib\\mingw\" />\n"
|
||||
"\t\t\t\t\t<Add directory=\"$(RESIDUAL_LIBS)lib\" />\n"
|
||||
"\t\t\t\t</Linker>\n";
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Resource compiler
|
||||
project << "\t\t\t\t<ResourceCompiler>\n"
|
||||
"\t\t\t\t\t<Add directory=\"..\\..\\dists\" />\n"
|
||||
"\t\t\t\t\t<Add directory=\"..\\..\\..\\scummvm\" />\n"
|
||||
"\t\t\t\t\t<Add directory=\"..\\..\\..\\residual\" />\n"
|
||||
"\t\t\t\t</ResourceCompiler>\n"
|
||||
"\t\t\t</Target>\n"
|
||||
"\t\t</Build>\n";
|
||||
@ -150,9 +150,9 @@ void CodeBlocksProvider::createProjectFile(const std::string &name, const std::s
|
||||
|
||||
} else {
|
||||
project << "\t\t\t<Target title=\"default\">\n"
|
||||
"\t\t\t\t<Option output=\"scummvm\\engines\\" << name << "\\lib" << name << "\" prefix_auto=\"1\" extension_auto=\"1\" />\n"
|
||||
"\t\t\t\t<Option output=\"residual\\engines\\" << name << "\\lib" << name << "\" prefix_auto=\"1\" extension_auto=\"1\" />\n"
|
||||
"\t\t\t\t<Option working_dir=\"\" />\n"
|
||||
"\t\t\t\t<Option object_output=\"scummvm\" />\n"
|
||||
"\t\t\t\t<Option object_output=\"residual\" />\n"
|
||||
"\t\t\t\t<Option type=\"2\" />\n"
|
||||
"\t\t\t\t<Option compiler=\"gcc\" />\n"
|
||||
"\t\t\t\t<Option createDefFile=\"1\" />\n"
|
||||
@ -163,11 +163,7 @@ void CodeBlocksProvider::createProjectFile(const std::string &name, const std::s
|
||||
|
||||
project << "\t\t\t\t\t<Add option=\"-g\" />\n"
|
||||
"\t\t\t\t\t<Add directory=\"..\\..\\engines\" />\n"
|
||||
"\t\t\t\t\t<Add directory=\"..\\..\\..\\scummvm\" />\n";
|
||||
|
||||
// Sword2.5 engine needs theora and vorbis includes
|
||||
if (name == "sword25")
|
||||
project << "\t\t\t\t\t<Add directory=\"$(SCUMMVM_LIBS)include\" />\n";
|
||||
"\t\t\t\t\t<Add directory=\"..\\..\\..\\residual\" />\n";
|
||||
|
||||
project << "\t\t\t\t</Compiler>\n"
|
||||
"\t\t\t</Target>\n"
|
||||
@ -233,7 +229,7 @@ void CodeBlocksProvider::writeFileListToProject(const FileNode &dir, std::ofstre
|
||||
"\t\t</Unit>\n";
|
||||
} else if (ext == "asm") {
|
||||
projectFile << "\t\t<Unit filename=\"" << convertPathToWin(filePrefix + node->name) << "\">\n"
|
||||
"\t\t\t<Option compiler=\"gcc\" use=\"1\" buildCommand=\"$(SCUMMVM_LIBS)bin/nasm.exe -f win32 -g $file -o $object\" />"
|
||||
"\t\t\t<Option compiler=\"gcc\" use=\"1\" buildCommand=\"$(RESIDUAL_LIBS)bin/nasm.exe -f win32 -g $file -o $object\" />"
|
||||
"\t\t</Unit>\n";
|
||||
} else {
|
||||
projectFile << "\t\t<Unit filename=\"" << convertPathToWin(filePrefix + node->name) << "\" />\n";
|
||||
@ -243,10 +239,10 @@ void CodeBlocksProvider::writeFileListToProject(const FileNode &dir, std::ofstre
|
||||
}
|
||||
|
||||
void CodeBlocksProvider::writeReferences(std::ofstream &output) {
|
||||
output << "\t\t<Project filename=\"scummvm.cbp\" active=\"1\">\n";
|
||||
output << "\t\t<Project filename=\"residual.cbp\" active=\"1\">\n";
|
||||
|
||||
for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
|
||||
if (i->first == "scummvm")
|
||||
if (i->first == "residual")
|
||||
continue;
|
||||
|
||||
output << "\t\t\t<Depends filename=\"" << i->first << ".cbp\" />\n";
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* Residual - A 3D game interpreter
|
||||
*
|
||||
* Residual is the legal property of its developers, whose names
|
||||
* ScummVM and Residual is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the AUTHORS
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
@ -150,7 +150,7 @@ int main(int argc, char *argv[]) {
|
||||
using std::cout;
|
||||
for (int i = 2; i < argc; ++i) {
|
||||
if (!std::strcmp(argv[i], "--list-engines")) {
|
||||
cout << " The following enables are available in the ScummVM source distribution\n"
|
||||
cout << " The following enables are available in the Residual source distribution\n"
|
||||
" located at \"" << srcDir << "\":\n";
|
||||
|
||||
cout << " state | name | description\n\n";
|
||||
@ -456,7 +456,7 @@ void displayHelp(const char *exe) {
|
||||
cout << "Usage:\n"
|
||||
<< exe << " path\\to\\source [optional options]\n"
|
||||
<< "\n"
|
||||
<< " Creates project files for the ScummVM source located at \"path\\to\\source\".\n"
|
||||
<< " Creates project files for the Residual source located at \"path\\to\\source\".\n"
|
||||
" The project files will be created in the directory where tool is run from and\n"
|
||||
" will include \"path\\to\\source\" for relative file paths, thus be sure that you\n"
|
||||
" pass a relative file path like \"..\\..\\trunk\".\n"
|
||||
@ -482,14 +482,14 @@ void displayHelp(const char *exe) {
|
||||
" --build-events Run custom build events as part of the build\n"
|
||||
" (default: false)\n"
|
||||
"\n"
|
||||
"ScummVM engine settings:\n"
|
||||
"Residual engine settings:\n"
|
||||
" --list-engines list all available engines and their default state\n"
|
||||
" --enable-engine enable building of the engine with the name \"engine\"\n"
|
||||
" --disable-engine disable building of the engine with the name \"engine\"\n"
|
||||
" --enable-all-engines enable building of all engines\n"
|
||||
" --disable-all-engines disable building of all engines\n"
|
||||
"\n"
|
||||
"ScummVM optional feature settings:\n"
|
||||
"Residual optional feature settings:\n"
|
||||
" --enable-name enable inclusion of the feature \"name\"\n"
|
||||
" --disable-name disable inclusion of the feature \"name\"\n"
|
||||
"\n"
|
||||
@ -690,18 +690,12 @@ const Feature s_features[] = {
|
||||
{ "mad", "USE_MAD", "libmad", true, "libmad (MP3) support" },
|
||||
{ "vorbis", "USE_VORBIS", "libvorbisfile_static libvorbis_static libogg_static", true, "Ogg Vorbis support" },
|
||||
{ "flac", "USE_FLAC", "libFLAC_static", true, "FLAC support" },
|
||||
{ "png", "USE_PNG", "libpng", true, "libpng support" },
|
||||
{ "theora", "USE_THEORADEC", "libtheora_static", true, "Theora decoding support" },
|
||||
{ "mpeg2", "USE_MPEG2", "libmpeg2", false, "mpeg2 codec for cutscenes" },
|
||||
|
||||
// ScummVM feature flags
|
||||
{ "scalers", "USE_SCALERS", "", true, "Scalers" },
|
||||
{ "hqscalers", "USE_HQ_SCALERS", "", true, "HQ scalers" },
|
||||
{ "16bit", "USE_RGB_COLOR", "", true, "16bit color support" },
|
||||
// Residual feature flags
|
||||
{ "mt32emu", "USE_MT32EMU", "", true, "integrated MT-32 emulator" },
|
||||
{ "nasm", "USE_NASM", "", true, "IA-32 assembly support" }, // This feature is special in the regard, that it needs additional handling.
|
||||
{ "opengl", "USE_OPENGL", "opengl32", true, "OpenGL support" },
|
||||
{ "indeo3", "USE_INDEO3", "", true, "Indeo3 codec support"},
|
||||
{ "translation", "USE_TRANSLATION", "", true, "Translation support" },
|
||||
{ "langdetect", "USE_DETECTLANG", "", true, "System language detection support" } // This feature actually depends on "translation", there
|
||||
// is just no current way of properly detecting this...
|
||||
@ -977,7 +971,7 @@ void ProjectProvider::createProject(const BuildSetup &setup) {
|
||||
_uuidMap = createUUIDMap(setup);
|
||||
|
||||
// We also need to add the UUID of the main project file.
|
||||
const std::string svmUUID = _uuidMap["scummvm"] = createUUID();
|
||||
const std::string svmUUID = _uuidMap["residual"] = createUUID();
|
||||
|
||||
// Create Solution/Workspace file
|
||||
createWorkspace(setup);
|
||||
@ -986,7 +980,7 @@ void ProjectProvider::createProject(const BuildSetup &setup) {
|
||||
|
||||
// Create engine project files
|
||||
for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
|
||||
if (i->first == "scummvm")
|
||||
if (i->first == "residual")
|
||||
continue;
|
||||
|
||||
in.clear(); ex.clear();
|
||||
@ -1009,23 +1003,21 @@ void ProjectProvider::createProject(const BuildSetup &setup) {
|
||||
createModuleList(setup.srcDir + "/gui", setup.defines, in, ex);
|
||||
createModuleList(setup.srcDir + "/audio", setup.defines, in, ex);
|
||||
createModuleList(setup.srcDir + "/audio/softsynth/mt32", setup.defines, in, ex);
|
||||
createModuleList(setup.srcDir + "/video", setup.defines, in, ex);
|
||||
|
||||
// Resource files
|
||||
in.push_back(setup.srcDir + "/icons/scummvm.ico");
|
||||
in.push_back(setup.srcDir + "/dists/scummvm.rc");
|
||||
in.push_back(setup.srcDir + "/icons/residual.ico");
|
||||
in.push_back(setup.srcDir + "/dists/residual.rc");
|
||||
|
||||
// Various text files
|
||||
in.push_back(setup.srcDir + "/AUTHORS");
|
||||
in.push_back(setup.srcDir + "/COPYING");
|
||||
in.push_back(setup.srcDir + "/COPYING.LGPL");
|
||||
in.push_back(setup.srcDir + "/COPYRIGHT");
|
||||
in.push_back(setup.srcDir + "/NEWS");
|
||||
in.push_back(setup.srcDir + "/README");
|
||||
in.push_back(setup.srcDir + "/TODO");
|
||||
|
||||
// Create the scummvm project file.
|
||||
createProjectFile("scummvm", svmUUID, setup, setup.srcDir, in, ex);
|
||||
createProjectFile("residual", svmUUID, setup, setup.srcDir, in, ex);
|
||||
|
||||
// Create other misc. build files
|
||||
createOtherBuildFiles(setup);
|
||||
|
@ -60,7 +60,7 @@ int MSBuildProvider::getVisualStudioVersion() {
|
||||
|
||||
#define OUTPUT_CONFIGURATION_TYPE_MSBUILD(config) \
|
||||
(project << "\t<PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='" << config << "'\" Label=\"Configuration\">\n" \
|
||||
"\t\t<ConfigurationType>" << (name == "scummvm" ? "Application" : "StaticLibrary") << "</ConfigurationType>\n" \
|
||||
"\t\t<ConfigurationType>" << (name == "residual" ? "Application" : "StaticLibrary") << "</ConfigurationType>\n" \
|
||||
"\t</PropertyGroup>\n")
|
||||
|
||||
#define OUTPUT_PROPERTIES_MSBUILD(config, properties) \
|
||||
@ -110,12 +110,12 @@ void MSBuildProvider::createProjectFile(const std::string &name, const std::stri
|
||||
"\t<ImportGroup Label=\"ExtensionSettings\">\n"
|
||||
"\t</ImportGroup>\n";
|
||||
|
||||
OUTPUT_PROPERTIES_MSBUILD("Release|Win32", "ScummVM_Release.props");
|
||||
OUTPUT_PROPERTIES_MSBUILD("Analysis|Win32", "ScummVM_Analysis.props");
|
||||
OUTPUT_PROPERTIES_MSBUILD("Debug|Win32", "ScummVM_Debug.props");
|
||||
OUTPUT_PROPERTIES_MSBUILD("Release|x64", "ScummVM_Release64.props");
|
||||
OUTPUT_PROPERTIES_MSBUILD("Analysis|x64", "ScummVM_Analysis64.props");
|
||||
OUTPUT_PROPERTIES_MSBUILD("Debug|x64", "ScummVM_Debug64.props");
|
||||
OUTPUT_PROPERTIES_MSBUILD("Release|Win32", "Residual_Release.props");
|
||||
OUTPUT_PROPERTIES_MSBUILD("Analysis|Win32", "Residual_Analysis.props");
|
||||
OUTPUT_PROPERTIES_MSBUILD("Debug|Win32", "Residual_Debug.props");
|
||||
OUTPUT_PROPERTIES_MSBUILD("Release|x64", "Residual_Release64.props");
|
||||
OUTPUT_PROPERTIES_MSBUILD("Analysis|x64", "Residual_Analysis64.props");
|
||||
OUTPUT_PROPERTIES_MSBUILD("Debug|x64", "Residual_Debug64.props");
|
||||
|
||||
project << "\t<PropertyGroup Label=\"UserMacros\" />\n";
|
||||
|
||||
@ -141,7 +141,7 @@ void MSBuildProvider::createProjectFile(const std::string &name, const std::stri
|
||||
addFilesToProject(moduleDir, project, includeList, excludeList, setup.filePrefix);
|
||||
|
||||
// Output references for scummvm project
|
||||
if (name == "scummvm")
|
||||
if (name == "residual")
|
||||
writeReferences(project);
|
||||
|
||||
project << "\t<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n"
|
||||
@ -212,7 +212,7 @@ void MSBuildProvider::writeReferences(std::ofstream &output) {
|
||||
output << "\t<ItemGroup>\n";
|
||||
|
||||
for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
|
||||
if (i->first == "scummvm")
|
||||
if (i->first == "residual")
|
||||
continue;
|
||||
|
||||
output << "\t<ProjectReference Include=\"" << i->first << ".vcxproj\">\n"
|
||||
@ -230,7 +230,7 @@ void MSBuildProvider::outputProjectSettings(std::ofstream &project, const std::s
|
||||
std::map<std::string, StringList>::iterator warningsIterator = _projectWarnings.find(name);
|
||||
|
||||
// Nothing to add here, move along!
|
||||
if (name != "scummvm" && name != "sword25" && name != "tinsel" && warningsIterator == _projectWarnings.end())
|
||||
if (name != "residual" && warningsIterator == _projectWarnings.end())
|
||||
return;
|
||||
|
||||
std::string warnings = "";
|
||||
@ -242,7 +242,7 @@ void MSBuildProvider::outputProjectSettings(std::ofstream &project, const std::s
|
||||
"\t\t<ClCompile>\n";
|
||||
|
||||
// Compile configuration
|
||||
if (name == "scummvm" || name == "sword25") {
|
||||
if (name == "residual") {
|
||||
project << "\t\t\t<DisableLanguageExtensions>false</DisableLanguageExtensions>\n";
|
||||
} else {
|
||||
if (name == "tinsel" && !isRelease)
|
||||
@ -255,14 +255,14 @@ void MSBuildProvider::outputProjectSettings(std::ofstream &project, const std::s
|
||||
project << "\t\t</ClCompile>\n";
|
||||
|
||||
// Link configuration for scummvm project
|
||||
if (name == "scummvm") {
|
||||
if (name == "residual") {
|
||||
std::string libraries;
|
||||
|
||||
for (StringList::const_iterator i = setup.libraries.begin(); i != setup.libraries.end(); ++i)
|
||||
libraries += *i + ".lib;";
|
||||
|
||||
project << "\t\t<Link>\n"
|
||||
"\t\t\t<OutputFile>$(OutDir)scummvm.exe</OutputFile>\n"
|
||||
"\t\t\t<OutputFile>$(OutDir)residual.exe</OutputFile>\n"
|
||||
"\t\t\t<AdditionalDependencies>" << libraries << "%(AdditionalDependencies)</AdditionalDependencies>\n"
|
||||
"\t\t</Link>\n";
|
||||
|
||||
@ -300,10 +300,10 @@ void MSBuildProvider::outputGlobalPropFile(std::ofstream &properties, int bits,
|
||||
"<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\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)\\lib\\" << (bits == 32 ? "x86" : "x64") << ";$(LibraryPath)</LibraryPath>\n"
|
||||
"\t\t<IncludePath>$(SCUMMVM_LIBS)\\include;$(IncludePath)</IncludePath>\n"
|
||||
"\t\t<_PropertySheetDisplayName>Residual_Global</_PropertySheetDisplayName>\n"
|
||||
"\t\t<ExecutablePath>$(RESIDUAL_LIBS)\\bin;$(ExecutablePath)</ExecutablePath>\n"
|
||||
"\t\t<LibraryPath>$(RESIDUAL_LIBS)\\lib\\" << (bits == 32 ? "x86" : "x64") << ";$(LibraryPath)</LibraryPath>\n"
|
||||
"\t\t<IncludePath>$(RESIDUAL_LIBS)\\include;$(IncludePath)</IncludePath>\n"
|
||||
"\t\t<OutDir>$(Configuration)" << bits << "\\</OutDir>\n"
|
||||
"\t\t<IntDir>$(Configuration)" << bits << "/$(ProjectName)\\</IntDir>\n"
|
||||
"\t</PropertyGroup>\n"
|
||||
@ -311,7 +311,7 @@ void MSBuildProvider::outputGlobalPropFile(std::ofstream &properties, int bits,
|
||||
"\t\t<ClCompile>\n"
|
||||
"\t\t\t<DisableLanguageExtensions>true</DisableLanguageExtensions>\n"
|
||||
"\t\t\t<DisableSpecificWarnings>" << warnings << ";%(DisableSpecificWarnings)</DisableSpecificWarnings>\n"
|
||||
"\t\t\t<AdditionalIncludeDirectories>$(SCUMMVM_LIBS)\\include;" << prefix << ";" << prefix << "\\engines;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n"
|
||||
"\t\t\t<AdditionalIncludeDirectories>$(RESIDUAL_LIBS)\\include;" << prefix << ";" << prefix << "\\engines;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n"
|
||||
"\t\t\t<PreprocessorDefinitions>" << definesList << "%(PreprocessorDefinitions)</PreprocessorDefinitions>\n"
|
||||
"\t\t\t<ExceptionHandling></ExceptionHandling>\n"
|
||||
"\t\t\t<RuntimeTypeInfo>false</RuntimeTypeInfo>\n"
|
||||
@ -338,18 +338,18 @@ void MSBuildProvider::createBuildProp(const BuildSetup &setup, bool isRelease, b
|
||||
const std::string outputType = (enableAnalysis ? "Analysis" : (isRelease ? "Release" : "Debug"));
|
||||
const std::string outputBitness = (isWin32 ? "32" : "64");
|
||||
|
||||
std::ofstream properties((setup.outputDir + '/' + "ScummVM_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension()).c_str());
|
||||
std::ofstream properties((setup.outputDir + '/' + "Residual_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension()).c_str());
|
||||
if (!properties)
|
||||
error("Could not open \"" + setup.outputDir + '/' + "ScummVM_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension() + "\" for writing");
|
||||
error("Could not open \"" + setup.outputDir + '/' + "Residual_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension() + "\" for writing");
|
||||
|
||||
properties << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
|
||||
"<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n"
|
||||
"\t<ImportGroup Label=\"PropertySheets\">\n"
|
||||
"\t\t<Import Project=\"ScummVM_Global" << (isWin32 ? "" : "64") << ".props\" />\n"
|
||||
"\t\t<Import Project=\"Residual_Global" << (isWin32 ? "" : "64") << ".props\" />\n"
|
||||
"\t</ImportGroup>\n"
|
||||
"\t<PropertyGroup>\n"
|
||||
"\t\t<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n"
|
||||
"\t\t<_PropertySheetDisplayName>ScummVM_" << outputType << outputBitness << "</_PropertySheetDisplayName>\n"
|
||||
"\t\t<_PropertySheetDisplayName>Residual_" << outputType << outputBitness << "</_PropertySheetDisplayName>\n"
|
||||
"\t\t<LinkIncremental>" << (isRelease ? "false" : "true") << "</LinkIncremental>\n"
|
||||
"\t</PropertyGroup>\n"
|
||||
"\t<ItemDefinitionGroup>\n"
|
||||
@ -440,7 +440,7 @@ void MSBuildProvider::writeFileListToProject(const FileNode &dir, std::ofstream
|
||||
"\t\t\t<ObjectFileName>$(IntDir)" << (*entry).prefix << "%(Filename).obj</ObjectFileName>\n";
|
||||
|
||||
if (hasEnding((*entry).path, "base\\version.cpp"))
|
||||
projectFile << "\t\t\t<PreprocessorDefinitions Condition=\"'$(Configuration)'=='Debug'\">SCUMMVM_REVISION#" $(SCUMMVM_REVISION_STRING)";%(PreprocessorDefinitions)</PreprocessorDefinitions>\n";
|
||||
projectFile << "\t\t\t<PreprocessorDefinitions Condition=\"'$(Configuration)'=='Debug'\">RESIDUAL_REVISION#" $(RESIDUAL_REVISION_STRING)";%(PreprocessorDefinitions)</PreprocessorDefinitions>\n";
|
||||
|
||||
projectFile << "\t\t</ClCompile>\n";
|
||||
} else {
|
||||
|
@ -39,23 +39,23 @@ MSVCProvider::MSVCProvider(StringList &global_warnings, std::map<std::string, St
|
||||
}
|
||||
|
||||
void MSVCProvider::createWorkspace(const BuildSetup &setup) {
|
||||
UUIDMap::const_iterator svmUUID = _uuidMap.find("scummvm");
|
||||
UUIDMap::const_iterator svmUUID = _uuidMap.find("residual");
|
||||
if (svmUUID == _uuidMap.end())
|
||||
error("No UUID for \"scummvm\" project created");
|
||||
error("No UUID for \"residual\" project created");
|
||||
|
||||
const std::string svmProjectUUID = svmUUID->second;
|
||||
assert(!svmProjectUUID.empty());
|
||||
|
||||
std::string solutionUUID = createUUID();
|
||||
|
||||
std::ofstream solution((setup.outputDir + '/' + "scummvm.sln").c_str());
|
||||
std::ofstream solution((setup.outputDir + '/' + "residual.sln").c_str());
|
||||
if (!solution)
|
||||
error("Could not open \"" + setup.outputDir + '/' + "scummvm.sln\" for writing");
|
||||
error("Could not open \"" + setup.outputDir + '/' + "residual.sln\" for writing");
|
||||
|
||||
solution << "Microsoft Visual Studio Solution File, Format Version " << _version + 1 << ".00\n";
|
||||
solution << "# Visual Studio " << getVisualStudioVersion() << "\n";
|
||||
|
||||
solution << "Project(\"{" << solutionUUID << "}\") = \"scummvm\", \"scummvm" << getProjectExtension() << "\", \"{" << svmProjectUUID << "}\"\n";
|
||||
solution << "Project(\"{" << solutionUUID << "}\") = \"residual\", \"residual" << getProjectExtension() << "\", \"{" << svmProjectUUID << "}\"\n";
|
||||
|
||||
// Project dependencies are moved to vcxproj files in Visual Studio 2010
|
||||
if (_version < 10)
|
||||
@ -65,7 +65,7 @@ void MSVCProvider::createWorkspace(const BuildSetup &setup) {
|
||||
|
||||
// Note we assume that the UUID map only includes UUIDs for enabled engines!
|
||||
for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
|
||||
if (i->first == "scummvm")
|
||||
if (i->first == "residual")
|
||||
continue;
|
||||
|
||||
solution << "Project(\"{" << solutionUUID << "}\") = \"" << i->first << "\", \"" << i->first << getProjectExtension() << "\", \"{" << i->second << "}\"\n"
|
||||
@ -120,16 +120,16 @@ void MSVCProvider::createOtherBuildFiles(const BuildSetup &setup) {
|
||||
}
|
||||
|
||||
void MSVCProvider::createGlobalProp(const BuildSetup &setup) {
|
||||
std::ofstream properties((setup.outputDir + '/' + "ScummVM_Global" + getPropertiesExtension()).c_str());
|
||||
std::ofstream properties((setup.outputDir + '/' + "Residual_Global" + getPropertiesExtension()).c_str());
|
||||
if (!properties)
|
||||
error("Could not open \"" + setup.outputDir + '/' + "ScummVM_Global" + getPropertiesExtension() + "\" for writing");
|
||||
error("Could not open \"" + setup.outputDir + '/' + "Residual_Global" + getPropertiesExtension() + "\" for writing");
|
||||
|
||||
outputGlobalPropFile(properties, 32, setup.defines, convertPathToWin(setup.filePrefix));
|
||||
properties.close();
|
||||
|
||||
properties.open((setup.outputDir + '/' + "ScummVM_Global64" + getPropertiesExtension()).c_str());
|
||||
properties.open((setup.outputDir + '/' + "Residual_Global64" + getPropertiesExtension()).c_str());
|
||||
if (!properties)
|
||||
error("Could not open \"" + setup.outputDir + '/' + "ScummVM_Global64" + getPropertiesExtension() + "\" for writing");
|
||||
error("Could not open \"" + setup.outputDir + '/' + "Residual_Global64" + getPropertiesExtension() + "\" for writing");
|
||||
|
||||
// HACK: We must disable the "nasm" feature for x64. To achieve that we must duplicate the feature list and
|
||||
// recreate a define list.
|
||||
|
41
devtools/create_project/scripts/postbuild.cmd
Normal file
41
devtools/create_project/scripts/postbuild.cmd
Normal file
@ -0,0 +1,41 @@
|
||||
REM @echo off
|
||||
|
||||
REM ---------------------------------------------------------------
|
||||
REM -- Post-Build Script
|
||||
REM ---------------------------------------------------------------
|
||||
REM
|
||||
REM Copy engine data, themes, translation and required dlls to the
|
||||
REM output folder.
|
||||
REM
|
||||
REM Expected parameters
|
||||
REM Root folder
|
||||
REM Output folder
|
||||
REM Architecture
|
||||
|
||||
if "%~1"=="" goto error_input
|
||||
if "%~2"=="" goto error_output
|
||||
if "%~3"=="" goto error_arch
|
||||
|
||||
echo Copying data files
|
||||
echo.
|
||||
|
||||
REM Copy files
|
||||
xcopy /F /Y "%~1/gui/themes/*.zip" %~2 > NUL 2>&1
|
||||
xcopy /F /Y "%~1/gui/themes/translations.dat" %~2 > NUL 2>&1
|
||||
xcopy /F /Y "%RESIDUAL_LIBS%/lib/%~3/SDL.dll" %~2 > NUL 2>&1
|
||||
goto done
|
||||
|
||||
:error_output
|
||||
echo Invalid root folder (%~1)!
|
||||
goto done
|
||||
|
||||
:error_output
|
||||
echo Invalid output folder (%~2)!
|
||||
goto done
|
||||
|
||||
:error_arch
|
||||
echo Invalid arch parameter (was: %~3, allowed: x86, x64)!
|
||||
goto done
|
||||
|
||||
:done
|
||||
exit /B0
|
27
devtools/create_project/scripts/prebuild.cmd
Normal file
27
devtools/create_project/scripts/prebuild.cmd
Normal file
@ -0,0 +1,27 @@
|
||||
@echo off
|
||||
|
||||
REM ---------------------------------------------------------------
|
||||
REM -- Pre-Build Script
|
||||
REM ---------------------------------------------------------------
|
||||
REM
|
||||
REM Generate file with proper revision number
|
||||
REM
|
||||
REM Expected parameters
|
||||
REM Root folder
|
||||
|
||||
if "%~1"=="" goto error_input
|
||||
|
||||
REM Run the revision script
|
||||
@call cscript "%~1/devtools/create_project/scripts/revision.vbs" %~1 1>NUL
|
||||
if not %errorlevel% == 0 goto error_script
|
||||
goto done
|
||||
|
||||
:error_output
|
||||
echo Invalid root folder (%~1)!
|
||||
goto done
|
||||
|
||||
:error_script:
|
||||
echo An error occured while running the revision script!
|
||||
|
||||
:done
|
||||
exit /B0
|
445
devtools/create_project/scripts/revision.vbs
Normal file
445
devtools/create_project/scripts/revision.vbs
Normal file
@ -0,0 +1,445 @@
|
||||
'
|
||||
' Residual - A 3D game interpreter
|
||||
'
|
||||
' Residual is the legal property of its developers, whose names
|
||||
' are too numerous to list here. Please refer to the AUTHORS
|
||||
' file distributed with this source distribution.
|
||||
'
|
||||
' This program is free software; you can redistribute it and/or
|
||||
' modify it under the terms of the GNU General Public License
|
||||
' as published by the Free Software Foundation, version 2
|
||||
' of the License.
|
||||
'
|
||||
' This program is distributed in the hope that it will be useful,
|
||||
' but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
' GNU General Public License for more details.
|
||||
'
|
||||
' You should have received a copy of the GNU General Public License
|
||||
' along with this program; if not, write to the Free Software
|
||||
' Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
'
|
||||
' Based off OpenTTD determineversion.vbs (released under GPL version 2)
|
||||
'
|
||||
'/
|
||||
|
||||
Option Explicit
|
||||
|
||||
' Working copy check priority:
|
||||
' True: TortoiseSVN -> SVN -> Git -> Hg
|
||||
' False: Git -> Hg -> TortoiseSVN -> SVN
|
||||
Dim prioritySVN: prioritySVN = False
|
||||
|
||||
Dim FSO : Set FSO = CreateObject("Scripting.FileSystemObject")
|
||||
Dim WshShell : Set WshShell = CreateObject("WScript.Shell")
|
||||
|
||||
' Folders
|
||||
Dim rootFolder : rootFolder = ""
|
||||
|
||||
' Info variables
|
||||
Dim tool : tool = ""
|
||||
Dim branch : branch = "trunk"
|
||||
Dim revision : revision = ""
|
||||
Dim modified : modified = False
|
||||
|
||||
' Parse our command line arguments
|
||||
If ParseCommandLine() Then
|
||||
' Determine the revision and update the props file with the revision numbers
|
||||
DetermineRevision()
|
||||
End If
|
||||
|
||||
'////////////////////////////////////////////////////////////////
|
||||
'// Revision checking
|
||||
'////////////////////////////////////////////////////////////////
|
||||
Sub DetermineRevision()
|
||||
Wscript.StdErr.WriteLine "Determining current revision:"
|
||||
|
||||
' Set the current directory to the root folder
|
||||
WshShell.CurrentDirectory = rootFolder
|
||||
|
||||
' Try until we find a proper working copy
|
||||
If (prioritySVN) Then
|
||||
If Not DetermineTortoiseSVNVersion() Then
|
||||
If Not DetermineSVNVersion() Then
|
||||
If Not DetermineGitVersion() Then
|
||||
If Not DetermineHgVersion() Then
|
||||
Wscript.StdErr.WriteLine "Could not determine the current revision, skipping..."
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
If Not DetermineGitVersion() Then
|
||||
If Not DetermineHgVersion() Then
|
||||
If Not DetermineTortoiseSVNVersion() Then
|
||||
If Not DetermineSVNVersion() Then
|
||||
Wscript.StdErr.WriteLine "Could not determine the current revision, skipping..."
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Wscript.StdErr.WriteLine "Found revision " & revision & " on branch " & branch & vbCrLf
|
||||
|
||||
' Setup our revision string
|
||||
Dim revisionString : revisionString = "r" & revision
|
||||
|
||||
If (modified) Then
|
||||
revisionString = revisionString & " M"
|
||||
End If
|
||||
|
||||
' If we are not on trunk, add the branch name to the revision string
|
||||
If (branch <> "trunk" And branch <> "") Then
|
||||
revisionString = revisionString & " (" & branch & ")"
|
||||
End If
|
||||
|
||||
' Add the DVCS name at the end
|
||||
revisionString = revisionString & " - " & tool
|
||||
|
||||
' Setup an environment variable with the revision string
|
||||
Dim Env: Set Env = WshShell.Environment("User")
|
||||
Env.item("RESIDUAL_REVISION_STRING") = revisionString
|
||||
End Sub
|
||||
|
||||
Function DetermineTortoiseSVNVersion()
|
||||
Err.Clear
|
||||
On Error Resume Next
|
||||
DetermineTortoiseSVNVersion = False
|
||||
Wscript.StdErr.Write " TortoiseSVN... "
|
||||
tool = "svn"
|
||||
|
||||
' Get the directory where TortoiseSVN (should) reside(s)
|
||||
Dim sTortoise
|
||||
|
||||
' First, try with 32-bit architecture
|
||||
sTortoise = ReadRegistryKey("HKLM", "SOFTWARE\TortoiseSVN", "Directory", 32)
|
||||
|
||||
If sTortoise = "" Or IsNull(sTortoise) Then
|
||||
' No 32-bit version of TortoiseSVN installed, try 64-bit version (doesn't hurt on 32-bit machines, it returns nothing or is ignored)
|
||||
sTortoise = ReadRegistryKey("HKLM", "SOFTWARE\TortoiseSVN", "Directory", 64)
|
||||
End If
|
||||
|
||||
' Check if Tortoise is present
|
||||
If sTortoise = "" Then
|
||||
Wscript.StdErr.WriteLine "TortoiseSVN not installed!"
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
' If TortoiseSVN is installed, try to get the revision number
|
||||
Dim SubWCRev : Set SubWCRev = WScript.CreateObject("SubWCRev.object")
|
||||
SubWCRev.GetWCInfo rootFolder, 0, 0
|
||||
|
||||
' Check if this is a working copy
|
||||
If Not SubWCRev.IsSvnItem Then
|
||||
Wscript.StdErr.WriteLine "Not a working copy!"
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
revision = SubWCRev.Revision
|
||||
|
||||
' Check for modifications
|
||||
If SubWCRev.HasModifications Then modified = True
|
||||
|
||||
If revision = "" Then
|
||||
Wscript.StdErr.WriteLine "No revision found!"
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
DetermineTortoiseSVNVersion = True
|
||||
End Function
|
||||
|
||||
Function DetermineSVNVersion()
|
||||
Err.Clear
|
||||
On Error Resume Next
|
||||
DetermineSVNVersion = False
|
||||
Wscript.StdErr.Write " SVN... "
|
||||
tool = "svn"
|
||||
|
||||
' Set the environment to English
|
||||
WshShell.Environment("PROCESS")("LANG") = "en"
|
||||
|
||||
' Do we have subversion installed? Check immediately whether we've got a modified WC.
|
||||
Dim oExec: Set oExec = WshShell.Exec("svnversion " & rootFolder)
|
||||
If Err.Number <> 0 Then
|
||||
Wscript.StdErr.WriteLine "SVN not installed!"
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
' Wait till the application is finished ...
|
||||
Do While oExec.Status = 0
|
||||
WScript.Sleep 100
|
||||
Loop
|
||||
|
||||
Dim line: line = OExec.StdOut.ReadLine()
|
||||
If line = "exported" Then
|
||||
Wscript.StdErr.WriteLine "Not a working copy!"
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
If InStr(line, "M") Then
|
||||
modified = True
|
||||
End If
|
||||
|
||||
' And use svn info to get the correct revision and branch information.
|
||||
Set oExec = WshShell.Exec("svn info " & rootFolder)
|
||||
|
||||
If Err.Number <> 0 Then
|
||||
Wscript.StdErr.WriteLine "No revision found!"
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
Do
|
||||
line = OExec.StdOut.ReadLine()
|
||||
If InStr(line, "Last Changed Rev") Then
|
||||
revision = Mid(line, 19)
|
||||
End If
|
||||
Loop While Not OExec.StdOut.atEndOfStream
|
||||
|
||||
If revision = 0 Then
|
||||
Wscript.StdErr.WriteLine "No revision found!"
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
DetermineSVNVersion = True
|
||||
End Function
|
||||
|
||||
Function DetermineGitVersion()
|
||||
Err.Clear
|
||||
On Error Resume Next
|
||||
DetermineGitVersion = False
|
||||
Wscript.StdErr.Write " Git... "
|
||||
tool = "git"
|
||||
|
||||
' First check if we have both a .git & .svn folders (in case hg-git has been set up to have the git folder at the working copy level)
|
||||
If FSO.FolderExists(rootFolder & "/.git") And FSO.FolderExists(rootFolder & "/.hg") Then
|
||||
Wscript.StdErr.WriteLine "Mercurial clone with git repository in tree!"
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
' Set the environment to English
|
||||
WshShell.Environment("PROCESS")("LANG") = "en"
|
||||
|
||||
' Detect if we are using msysgit that has a cmd script in the path instead of an exe...
|
||||
Dim gitPath : gitPath = "git "
|
||||
Dim oExec : Set oExec = WshShell.Exec("git")
|
||||
If Err.Number <> 0 Then
|
||||
gitPath = "git.cmd "
|
||||
End If
|
||||
|
||||
Err.Clear
|
||||
Set oExec = WshShell.Exec(gitPath & "rev-parse --verify HEAD")
|
||||
If Err.Number <> 0 Then
|
||||
Wscript.StdErr.WriteLine "Git not installed!"
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
' Wait till the application is finished ...
|
||||
Do While oExec.Status = 0
|
||||
WScript.Sleep 100
|
||||
Loop
|
||||
|
||||
If oExec.ExitCode <> 0 Then
|
||||
Wscript.StdErr.WriteLine "Error parsing git revision!"
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
' Get the version hash
|
||||
Dim hash: hash = oExec.StdOut.ReadLine()
|
||||
|
||||
' Make sure index is in sync with disk
|
||||
Set oExec = WshShell.Exec(gitPath & "update-index --refresh")
|
||||
If Err.Number = 0 Then
|
||||
' Wait till the application is finished ...
|
||||
Do While oExec.Status = 0
|
||||
WScript.Sleep 100
|
||||
Loop
|
||||
End If
|
||||
|
||||
Set oExec = WshShell.Exec(gitPath & "diff-index --exit-code --quiet HEAD " & rootFolder)
|
||||
If oExec.ExitCode <> 0 Then
|
||||
Wscript.StdErr.WriteLine "Error parsing git revision!"
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
' Wait till the application is finished ...
|
||||
Do While oExec.Status = 0
|
||||
WScript.Sleep 100
|
||||
Loop
|
||||
|
||||
If oExec.ExitCode = 1 Then
|
||||
modified = True
|
||||
End If
|
||||
|
||||
' Get branch name
|
||||
Set oExec = WshShell.Exec(gitPath & "symbolic-ref HEAD")
|
||||
If Err.Number = 0 Then
|
||||
Dim line: line = oExec.StdOut.ReadLine()
|
||||
line = Mid(line, InStrRev(line, "/") + 1)
|
||||
If line <> "master" Then
|
||||
branch = line
|
||||
End If
|
||||
End If
|
||||
|
||||
' Check for svn clones
|
||||
Set oExec = WshShell.Exec(gitPath & "log --pretty=format:%s --grep=" & Chr(34) & "^(svn r[0-9]*)" & Chr(34) & " -1 " & rootFolder)
|
||||
if Err.Number = 0 Then
|
||||
revision = Mid(oExec.StdOut.ReadLine(), 7)
|
||||
revision = Mid(revision, 1, InStr(revision, ")") - 1)
|
||||
tool = "svn-git"
|
||||
End If
|
||||
|
||||
' No revision? Maybe it is a custom git-svn clone
|
||||
If revision = "" Then
|
||||
Err.Clear
|
||||
Set oExec = WshShell.Exec(gitPath & "log --pretty=format:%b --grep=" & Chr(34) & "git-svn-id:.*@[0-9]*" & Chr(34) & " -1 " & rootFolder)
|
||||
If Err.Number = 0 Then
|
||||
revision = oExec.StdOut.ReadLine()
|
||||
revision = Mid(revision, InStr(revision, "@") + 1)
|
||||
revision = Mid(revision, 1, InStr(revision, " ") - 1)
|
||||
tool = "svn-git"
|
||||
End If
|
||||
End If
|
||||
|
||||
' Fallback to abbreviated revision number
|
||||
If revision = "" Then
|
||||
revision = Mid(hash, 1, 8)
|
||||
End If
|
||||
|
||||
DetermineGitVersion = True
|
||||
End Function
|
||||
|
||||
Function DetermineHgVersion()
|
||||
Err.Clear
|
||||
On Error Resume Next
|
||||
DetermineHgVersion = False
|
||||
Wscript.StdErr.Write " Mercurial... "
|
||||
tool = "hg"
|
||||
|
||||
Err.Clear
|
||||
Dim oExec: Set oExec = WshShell.Exec("hg parents --template ""{rev}:{node|short}""")
|
||||
If Err.Number <> 0 Then
|
||||
Wscript.StdErr.WriteLine "Mercurial not installed!"
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
' Wait till the application is finished ...
|
||||
Do While oExec.Status = 0
|
||||
WScript.Sleep 100
|
||||
Loop
|
||||
|
||||
If oExec.ExitCode <> 0 Then
|
||||
Wscript.StdErr.WriteLine "Error parsing mercurial revision!"
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
Dim info : info = Split(OExec.StdOut.ReadLine(), ":")
|
||||
Dim version : version = info(0)
|
||||
Dim hash : hash = info(1)
|
||||
|
||||
Set oExec = WshShell.Exec("hg status " & rootFolder)
|
||||
If Err.Number <> 0 Then
|
||||
Wscript.StdErr.WriteLine "Error parsing mercurial revision!"
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
' Check for modifications
|
||||
Do
|
||||
line = OExec.StdOut.ReadLine()
|
||||
If Len(line) > 0 And Mid(line, 1, 1) <> "?" Then
|
||||
modified = True
|
||||
Exit Do
|
||||
End If
|
||||
Loop While Not OExec.StdOut.atEndOfStream
|
||||
|
||||
' Check for branch
|
||||
Set oExec = WshShell.Exec("hg branch")
|
||||
If Err.Number = 0 Then
|
||||
line = OExec.StdOut.ReadLine()
|
||||
If line <> "default" Then
|
||||
branch = line
|
||||
End If
|
||||
End If
|
||||
|
||||
' Check for SVN clone
|
||||
Set oExec = WshShell.Exec("hg log -f -l 1 --template ""{svnrev}\n"" --cwd " & rootFolder)
|
||||
If Err.Number = 0 Then
|
||||
revision = Mid(OExec.StdOut.ReadLine(), 7)
|
||||
revision = Mid(revision, 1, InStr(revision, ")") - 1)
|
||||
tool = "svn-hg"
|
||||
End If
|
||||
|
||||
' Fallback to abbreviated revision number
|
||||
If revision = "" Then
|
||||
revision = version & "(" & hash & ")"
|
||||
End If
|
||||
|
||||
DetermineHgVersion = True
|
||||
End Function
|
||||
|
||||
'////////////////////////////////////////////////////////////////
|
||||
'// Utilities
|
||||
'////////////////////////////////////////////////////////////////
|
||||
Function ParseCommandLine()
|
||||
ParseCommandLine = True
|
||||
|
||||
If Wscript.Arguments.Count <> 1 Then
|
||||
Wscript.StdErr.WriteLine "[Error] Invalid number of arguments (was: " & Wscript.Arguments.Count & ", expected: 1)"
|
||||
|
||||
ParseCommandLine = False
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
' Get our arguments
|
||||
rootFolder = Wscript.Arguments.Item(0)
|
||||
|
||||
' Check that the folders are valid
|
||||
If Not FSO.FolderExists(rootFolder) Then
|
||||
Wscript.StdErr.WriteLine "[Error] Invalid root folder (" & rootFolder & ")"
|
||||
|
||||
ParseCommandLine = False
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
' Set absolute path
|
||||
rootFolder = FSO.GetAbsolutePathName(rootFolder)
|
||||
End Function
|
||||
|
||||
Function ReadRegistryKey(shive, subkey, valuename, architecture)
|
||||
Dim hiveKey, objCtx, objLocator, objServices, objReg, Inparams, Outparams
|
||||
|
||||
' First, get the Registry Provider for the requested architecture
|
||||
Set objCtx = CreateObject("WbemScripting.SWbemNamedValueSet")
|
||||
objCtx.Add "__ProviderArchitecture", architecture ' Must be 64 of 32
|
||||
Set objLocator = CreateObject("Wbemscripting.SWbemLocator")
|
||||
Set objServices = objLocator.ConnectServer("","root\default","","",,,,objCtx)
|
||||
Set objReg = objServices.Get("StdRegProv")
|
||||
|
||||
' Check the hive and give it the right value
|
||||
Select Case shive
|
||||
Case "HKCR", "HKEY_CLASSES_ROOT"
|
||||
hiveKey = &h80000000
|
||||
Case "HKCU", "HKEY_CURRENT_USER"
|
||||
hiveKey = &H80000001
|
||||
Case "HKLM", "HKEY_LOCAL_MACHINE"
|
||||
hiveKey = &h80000002
|
||||
Case "HKU", "HKEY_USERS"
|
||||
hiveKey = &h80000003
|
||||
Case "HKCC", "HKEY_CURRENT_CONFIG"
|
||||
hiveKey = &h80000005
|
||||
Case "HKDD", "HKEY_DYN_DATA" ' Only valid for Windows 95/98
|
||||
hiveKey = &h80000006
|
||||
Case Else
|
||||
MsgBox "Hive not valid (ReadRegistryKey)"
|
||||
End Select
|
||||
|
||||
Set Inparams = objReg.Methods_("GetStringValue").Inparameters
|
||||
Inparams.Hdefkey = hiveKey
|
||||
Inparams.Ssubkeyname = subkey
|
||||
Inparams.Svaluename = valuename
|
||||
Set Outparams = objReg.ExecMethod_("GetStringValue", Inparams,,objCtx)
|
||||
|
||||
ReadRegistryKey = Outparams.SValue
|
||||
End Function
|
@ -54,22 +54,22 @@ int VisualStudioProvider::getVisualStudioVersion() {
|
||||
if (_version == 8)
|
||||
return 2005;
|
||||
|
||||
error("Unsupported version passed to createScummVMSolution");
|
||||
error("Unsupported version passed to createResidualSolution");
|
||||
}
|
||||
|
||||
#define OUTPUT_CONFIGURATION_SCUMMVM(config, platform, props) { \
|
||||
project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"1\" InheritedPropertySheets=\".\\ScummVM_" << config << props << ".vsprops\">\n" \
|
||||
#define OUTPUT_CONFIGURATION_RESIDUAL(config, platform, props) { \
|
||||
project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"1\" InheritedPropertySheets=\".\\Residual_" << config << props << ".vsprops\">\n" \
|
||||
"\t\t\t<Tool\tName=\"VCCLCompilerTool\" DisableLanguageExtensions=\"false\" />\n" \
|
||||
"\t\t\t<Tool\tName=\"VCLinkerTool\" OutputFile=\"$(OutDir)/scummvm.exe\"\n" \
|
||||
"\t\t\t<Tool\tName=\"VCLinkerTool\" OutputFile=\"$(OutDir)/residual.exe\"\n" \
|
||||
"\t\t\t\tAdditionalDependencies=\"" << libraries << "\"\n" \
|
||||
"\t\t\t/>\n" \
|
||||
"\t\t</Configuration>\n"; \
|
||||
}
|
||||
|
||||
#define OUTPUT_CONFIGURATION_SCUMMVM_DEBUG(config, platform, props, isWin32) { \
|
||||
project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"1\" InheritedPropertySheets=\".\\ScummVM_" << config << props << ".vsprops\">\n" \
|
||||
#define OUTPUT_CONFIGURATION_RESIDUAL_DEBUG(config, platform, props, isWin32) { \
|
||||
project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"1\" InheritedPropertySheets=\".\\Residual_" << config << props << ".vsprops\">\n" \
|
||||
"\t\t\t<Tool\tName=\"VCCLCompilerTool\" DisableLanguageExtensions=\"false\" />\n" \
|
||||
"\t\t\t<Tool\tName=\"VCLinkerTool\" OutputFile=\"$(OutDir)/scummvm.exe\"\n" \
|
||||
"\t\t\t<Tool\tName=\"VCLinkerTool\" OutputFile=\"$(OutDir)/residual.exe\"\n" \
|
||||
"\t\t\t\tAdditionalDependencies=\"" << libraries << "\"\n" \
|
||||
"\t\t\t/>\n"; \
|
||||
if (setup.runBuildEvents) { \
|
||||
@ -84,7 +84,7 @@ int VisualStudioProvider::getVisualStudioVersion() {
|
||||
}
|
||||
|
||||
#define OUTPUT_CONFIGURATION(config, platform, props) { \
|
||||
project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"4\" InheritedPropertySheets=\".\\ScummVM_" << config << props << ".vsprops\">\n" \
|
||||
project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"4\" InheritedPropertySheets=\".\\Residual_" << config << props << ".vsprops\">\n" \
|
||||
"\t\t\t<Tool Name=\"VCCLCompilerTool\" "<< toolConfig << "/>\n" \
|
||||
"\t\t</Configuration>\n"; \
|
||||
}
|
||||
@ -118,24 +118,24 @@ void VisualStudioProvider::createProjectFile(const std::string &name, const std:
|
||||
// Check for project-specific warnings:
|
||||
std::map< std::string, std::list<std::string> >::iterator warningsIterator = _projectWarnings.find(name);
|
||||
|
||||
if (name == "scummvm") {
|
||||
if (name == "residual") {
|
||||
std::string libraries;
|
||||
|
||||
for (StringList::const_iterator i = setup.libraries.begin(); i != setup.libraries.end(); ++i)
|
||||
libraries += ' ' + *i + ".lib";
|
||||
|
||||
// Win32
|
||||
OUTPUT_CONFIGURATION_SCUMMVM_DEBUG("Debug", "Win32", "", true);
|
||||
OUTPUT_CONFIGURATION_SCUMMVM_DEBUG("Analysis", "Win32", "", true);
|
||||
OUTPUT_CONFIGURATION_SCUMMVM("Release", "Win32", "");
|
||||
OUTPUT_CONFIGURATION_RESIDUAL_DEBUG("Debug", "Win32", "", true);
|
||||
OUTPUT_CONFIGURATION_RESIDUAL_DEBUG("Analysis", "Win32", "", true);
|
||||
OUTPUT_CONFIGURATION_RESIDUAL("Release", "Win32", "");
|
||||
|
||||
// x64
|
||||
// For 'x64' we must disable NASM support. Usually we would need to disable the "nasm" feature for that and
|
||||
// re-create the library list, BUT since NASM doesn't link any additional libraries, we can just use the
|
||||
// libraries list created for IA-32. If that changes in the future, we need to adjust this part!
|
||||
OUTPUT_CONFIGURATION_SCUMMVM_DEBUG("Debug", "x64", "64", true);
|
||||
OUTPUT_CONFIGURATION_SCUMMVM_DEBUG("Analysis", "x64", "64", true);
|
||||
OUTPUT_CONFIGURATION_SCUMMVM("Release", "x64", "64");
|
||||
OUTPUT_CONFIGURATION_RESIDUAL_DEBUG("Debug", "x64", "64", true);
|
||||
OUTPUT_CONFIGURATION_RESIDUAL_DEBUG("Analysis", "x64", "64", true);
|
||||
OUTPUT_CONFIGURATION_RESIDUAL("Release", "x64", "64");
|
||||
|
||||
} else {
|
||||
std::string warnings = "";
|
||||
@ -180,7 +180,7 @@ void VisualStudioProvider::writeReferences(std::ofstream &output) {
|
||||
output << "\tProjectSection(ProjectDependencies) = postProject\n";
|
||||
|
||||
for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
|
||||
if (i->first == "scummvm")
|
||||
if (i->first == "residual")
|
||||
continue;
|
||||
|
||||
output << "\t\t{" << i->second << "} = {" << i->second << "}\n";
|
||||
@ -205,7 +205,7 @@ void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int b
|
||||
"<VisualStudioPropertySheet\n"
|
||||
"\tProjectType=\"Visual C++\"\n"
|
||||
"\tVersion=\"8.00\"\n"
|
||||
"\tName=\"ScummVM_Global\"\n"
|
||||
"\tName=\"Residual_Global\"\n"
|
||||
"\tOutputDirectory=\"$(ConfigurationName)" << bits << "\"\n"
|
||||
"\tIntermediateDirectory=\"$(ConfigurationName)" << bits << "/$(ProjectName)\"\n"
|
||||
"\t>\n"
|
||||
@ -213,7 +213,7 @@ void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int b
|
||||
"\t\tName=\"VCCLCompilerTool\"\n"
|
||||
"\t\tDisableLanguageExtensions=\"true\"\n"
|
||||
"\t\tDisableSpecificWarnings=\"" << warnings << "\"\n"
|
||||
"\t\tAdditionalIncludeDirectories=\"" << prefix << ";" << prefix << "\\engines;$(SCUMMVM_LIBS)\\include\"\n"
|
||||
"\t\tAdditionalIncludeDirectories=\"" << prefix << ";" << prefix << "\\engines;$(RESIDUAL_LIBS)\\include\"\n"
|
||||
"\t\tPreprocessorDefinitions=\"" << definesList << "\"\n"
|
||||
"\t\tExceptionHandling=\"0\"\n"
|
||||
"\t\tRuntimeTypeInfo=\"false\"\n"
|
||||
@ -230,7 +230,7 @@ void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int b
|
||||
"\t\tIgnoreDefaultLibraryNames=\"\"\n"
|
||||
"\t\tSubSystem=\"1\"\n"
|
||||
"\t\tEntryPointSymbol=\"WinMainCRTStartup\"\n"
|
||||
"\t\tAdditionalLibraryDirectories=\"$(SCUMMVM_LIBS)\\lib\\" << ((bits == 32) ? "x86" : "x64") << "\"\n"
|
||||
"\t\tAdditionalLibraryDirectories=\"$(RESIDUAL_LIBS)\\lib\\" << ((bits == 32) ? "x86" : "x64") << "\"\n"
|
||||
"\t/>\n"
|
||||
"\t<Tool\n"
|
||||
"\t\tName=\"VCResourceCompilerTool\"\n"
|
||||
@ -246,16 +246,16 @@ void VisualStudioProvider::createBuildProp(const BuildSetup &setup, bool isRelea
|
||||
const std::string outputType = (enableAnalysis ? "Analysis" : (isRelease ? "Release" : "Debug"));
|
||||
const std::string outputBitness = (isWin32 ? "32" : "64");
|
||||
|
||||
std::ofstream properties((setup.outputDir + '/' + "ScummVM_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension()).c_str());
|
||||
std::ofstream properties((setup.outputDir + '/' + "Residual_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension()).c_str());
|
||||
if (!properties)
|
||||
error("Could not open \"" + setup.outputDir + '/' + "ScummVM_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension() + "\" for writing");
|
||||
error("Could not open \"" + setup.outputDir + '/' + "Residual_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension() + "\" for writing");
|
||||
|
||||
properties << "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n"
|
||||
"<VisualStudioPropertySheet\n"
|
||||
"\tProjectType=\"Visual C++\"\n"
|
||||
"\tVersion=\"8.00\"\n"
|
||||
"\tName=\"ScummVM_" << outputType << outputBitness << "\"\n"
|
||||
"\tInheritedPropertySheets=\".\\ScummVM_Global" << (isWin32 ? "" : "64") << ".vsprops\"\n"
|
||||
"\tName=\"Residual_" << outputType << outputBitness << "\"\n"
|
||||
"\tInheritedPropertySheets=\".\\Residual_Global" << (isWin32 ? "" : "64") << ".vsprops\"\n"
|
||||
"\t>\n"
|
||||
"\t<Tool\n"
|
||||
"\t\tName=\"VCCLCompilerTool\"\n";
|
||||
|
Loading…
x
Reference in New Issue
Block a user