diff --git a/devtools/create_project/codeblocks.cpp b/devtools/create_project/codeblocks.cpp
index 4d00d31bc1c..ff596bf53d6 100644
--- a/devtools/create_project/codeblocks.cpp
+++ b/devtools/create_project/codeblocks.cpp
@@ -45,7 +45,7 @@ void CodeBlocksProvider::createWorkspace(const BuildSetup &setup) {
writeReferences(setup, 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) {
+ for (UUIDMap::const_iterator i = _allProjUuidMap.begin(); i != _allProjUuidMap.end(); ++i) {
if (i->first == setup.projectName)
continue;
@@ -153,7 +153,7 @@ void CodeBlocksProvider::createProjectFile(const std::string &name, const std::s
for (StringList::const_iterator i = libraries.begin(); i != libraries.end(); ++i)
project << "\t\t\t\t\t\n";
- for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
+ for (UUIDMap::const_iterator i = _allProjUuidMap.begin(); i != _allProjUuidMap.end(); ++i) {
if (i->first == setup.projectName)
continue;
@@ -277,7 +277,7 @@ void CodeBlocksProvider::writeFileListToProject(const FileNode &dir, std::ofstre
void CodeBlocksProvider::writeReferences(const BuildSetup &setup, std::ofstream &output) {
output << "\t\t\n";
- for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
+ for (UUIDMap::const_iterator i = _allProjUuidMap.begin(); i != _allProjUuidMap.end(); ++i) {
if (i->first == " << PROJECT_NAME << ")
continue;
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index b2f539526de..4db92312f56 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -1500,22 +1500,26 @@ void ProjectProvider::createProject(BuildSetup &setup) {
std::string targetFolder;
if (setup.devTools) {
- _uuidMap = createToolsUUIDMap();
+ _engineUuidMap = createToolsUUIDMap();
targetFolder = "/devtools/";
} else if (!setup.tests) {
- _uuidMap = createUUIDMap(setup);
+ _engineUuidMap = createUUIDMap(setup);
targetFolder = "/engines/";
}
+ _allProjUuidMap = _engineUuidMap;
+
// We also need to add the UUID of the main project file.
- const std::string svmUUID = _uuidMap[setup.projectName] = createUUID(setup.projectName);
+ const std::string svmUUID = _allProjUuidMap[setup.projectName] = createUUID(setup.projectName);
+ // Add the uuid of the detection project
+ const std::string detUUID = _allProjUuidMap["scummvm-detection"] = createUUID("scummvm-detection");
createWorkspace(setup);
StringList in, ex;
// Create project files
- for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
+ for (UUIDMap::const_iterator i = _engineUuidMap.begin(); i != _engineUuidMap.end(); ++i) {
if (i->first == setup.projectName)
continue;
// Retain the files between engines if we're creating a single project
@@ -1528,6 +1532,28 @@ void ProjectProvider::createProject(BuildSetup &setup) {
createProjectFile(i->first, i->second, setup, moduleDir, in, ex);
}
+ // Create engine-detection submodules.
+ {
+ in.clear();
+ ex.clear();
+ std::vector detectionModuleDirs;
+ detectionModuleDirs.reserve(setup.engines.size());
+
+ for (EngineDescList::const_iterator i = setup.engines.begin(), end = setup.engines.end(); i != end; ++i) {
+ // We ignore all sub engines here because they require no special handling.
+ if (isSubEngine(i->name, setup.engines)) {
+ continue;
+ }
+ detectionModuleDirs.push_back(setup.srcDir + "/engines/" + i->name);
+ }
+
+ for (std::string &str : detectionModuleDirs) {
+ createModuleList(str, setup.defines, setup.testDirs, in, ex, true);
+ }
+
+ createProjectFile("Detection", detUUID, setup, setup.srcDir, in, ex);
+ }
+
if (setup.tests) {
// Create the main project file.
in.clear();
@@ -1561,24 +1587,6 @@ void ProjectProvider::createProject(BuildSetup &setup) {
createModuleList(setup.srcDir + "/image", setup.defines, setup.testDirs, in, ex);
createModuleList(setup.srcDir + "/math", setup.defines, setup.testDirs, in, ex);
- // Create engine-detection submodules.
- if (setup.useStaticDetection) {
- std::vector detectionModuleDirs;
- detectionModuleDirs.reserve(setup.engines.size());
-
- for (EngineDescList::const_iterator i = setup.engines.begin(), end = setup.engines.end(); i != end; ++i) {
- // We ignore all sub engines here because they require no special handling.
- if (isSubEngine(i->name, setup.engines)) {
- continue;
- }
- detectionModuleDirs.push_back(setup.srcDir + "/engines/" + i->name);
- }
-
- for (std::string &str : detectionModuleDirs) {
- createModuleList(str, setup.defines, setup.testDirs, in, ex, true);
- }
- }
-
// Resource files
addResourceFiles(setup, in, ex);
diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h
index 1c4aaac7ece..b40509648bd 100644
--- a/devtools/create_project/create_project.h
+++ b/devtools/create_project/create_project.h
@@ -482,7 +482,8 @@ protected:
StringList &_globalWarnings; ///< Global warnings
std::map &_projectWarnings; ///< Per-project warnings
- UUIDMap _uuidMap; ///< List of (project name, UUID) pairs
+ UUIDMap _engineUuidMap; ///< List of (project name, UUID) pairs
+ UUIDMap _allProjUuidMap;
/**
* Create workspace/solution file
diff --git a/devtools/create_project/msbuild.cpp b/devtools/create_project/msbuild.cpp
index efe91d25868..421a8f6afba 100644
--- a/devtools/create_project/msbuild.cpp
+++ b/devtools/create_project/msbuild.cpp
@@ -255,7 +255,7 @@ void MSBuildProvider::outputFilter(std::ostream &filters, const FileEntries &fil
void MSBuildProvider::writeReferences(const BuildSetup &setup, std::ofstream &output) {
output << "\t\n";
- for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
+ for (UUIDMap::const_iterator i = _allProjUuidMap.begin(); i != _allProjUuidMap.end(); ++i) {
if (i->first == setup.projectName)
continue;
diff --git a/devtools/create_project/msvc.cpp b/devtools/create_project/msvc.cpp
index 6719f0c4b2b..b7aa1837185 100644
--- a/devtools/create_project/msvc.cpp
+++ b/devtools/create_project/msvc.cpp
@@ -144,8 +144,8 @@ std::string MSVCProvider::outputLibraryDependencies(const BuildSetup &setup, boo
}
void MSVCProvider::createWorkspace(const BuildSetup &setup) {
- UUIDMap::const_iterator svmUUID = _uuidMap.find(setup.projectName);
- if (svmUUID == _uuidMap.end())
+ UUIDMap::const_iterator svmUUID = _allProjUuidMap.find(setup.projectName);
+ if (svmUUID == _allProjUuidMap.end())
error("No UUID for \"" + setup.projectName + "\" project created");
const std::string svmProjectUUID = svmUUID->second;
@@ -174,7 +174,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) {
+ for (UUIDMap::const_iterator i = _allProjUuidMap.begin(); i != _allProjUuidMap.end(); ++i) {
if (i->first == setup.projectName)
continue;
@@ -195,7 +195,7 @@ void MSVCProvider::createWorkspace(const BuildSetup &setup) {
solution << "\tEndGlobalSection\n"
"\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n";
- for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
+ for (UUIDMap::const_iterator i = _allProjUuidMap.begin(); i != _allProjUuidMap.end(); ++i) {
for (std::list::const_iterator arch = _archs.begin(); arch != _archs.end(); ++arch) {
solution << "\t\t{" << i->second << "}.Debug|" << getMSVCConfigName(*arch) << ".ActiveCfg = Debug|" << getMSVCConfigName(*arch) << "\n"
<< "\t\t{" << i->second << "}.Debug|" << getMSVCConfigName(*arch) << ".Build.0 = Debug|" << getMSVCConfigName(*arch) << "\n"
diff --git a/devtools/create_project/visualstudio.cpp b/devtools/create_project/visualstudio.cpp
index 9ce8b66a878..36c086bc91d 100644
--- a/devtools/create_project/visualstudio.cpp
+++ b/devtools/create_project/visualstudio.cpp
@@ -175,7 +175,7 @@ void VisualStudioProvider::outputBuildEvents(std::ostream &project, const BuildS
void VisualStudioProvider::writeReferences(const BuildSetup &setup, std::ofstream &output) {
output << "\tProjectSection(ProjectDependencies) = postProject\n";
- for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
+ for (UUIDMap::const_iterator i = _allProjUuidMap.begin(); i != _allProjUuidMap.end(); ++i) {
if (i->first == setup.projectName)
continue;