[Scummvm-git-logs] scummvm master -> 436f1ba155582b246e03821a05f2ac3bb09b1d76

bluegr noreply at scummvm.org
Mon Jan 5 13:27:06 UTC 2026


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
436f1ba155 CREATE_PROJECT: add support for SLNX files


Commit: 436f1ba155582b246e03821a05f2ac3bb09b1d76
    https://github.com/scummvm/scummvm/commit/436f1ba155582b246e03821a05f2ac3bb09b1d76
Author: Michael (michael_kuerbis at web.de)
Date: 2026-01-05T15:27:02+02:00

Commit Message:
CREATE_PROJECT: add support for SLNX files

Visual Studio 2022 17.14 introduces SLNX as a new XML-based solution format.
This change allows to create the solution as such an SLNX file instead of SLN.

Changed paths:
    devtools/create_project/create_project.cpp
    devtools/create_project/create_project.h
    devtools/create_project/msvc.cpp
    devtools/create_project/msvc.h


diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index 15159cb7a00..b9ff27b7a00 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -311,6 +311,8 @@ int main(int argc, char *argv[]) {
 			setup.useSDL = kSDLVersion3;
 		} else if (!std::strcmp(argv[i], "--use-canonical-lib-names")) {
 			// Deprecated: Kept here so it doesn't error
+		} else if (!std::strcmp(argv[i], "--use-slnx")) {
+			setup.useSlnx = true;
 		} else if (!std::strcmp(argv[i], "--use-windows-unicode")) {
 			setup.useWindowsUnicode = true;
 		} else if (!std::strcmp(argv[i], "--use-windows-ansi")) {
@@ -577,6 +579,11 @@ int main(int argc, char *argv[]) {
 			return -1;
 		}
 
+		if (setup.useSlnx && msvc->version < 17) {
+			std::cerr << "ERROR: Using SLNX solution files requires Visual Studio 2022 17.14 or higher\n";
+			return 1;
+		}
+
 		////////////////////////////////////////////////////////////////////////////
 		// For Visual Studio, all warnings are on by default in the project files,
 		// so we pass a list of warnings to disable globally or per-project
@@ -818,7 +825,9 @@ void displayHelp(const char *exe) {
 	        " --tests                    Create project files for the tests\n"
 	        "                            (ignores --build-events and --installer, as well as engine settings)\n"
 	        "                            (default: false)\n"
-	        " --use-windows-unicode      Use Windows Unicode APIs\n"
+			" --use-slnx                 Use new XML-based Visual Studio solution format\n"
+			"                            (default: false)\n"
+			" --use-windows-unicode      Use Windows Unicode APIs\n"
 	        "                            (default: true)\n"
 	        " --use-windows-ansi         Use Windows ANSI APIs\n"
 	        "                            (default: false)\n"
diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h
index d135719c043..ebeca83ec25 100644
--- a/devtools/create_project/create_project.h
+++ b/devtools/create_project/create_project.h
@@ -301,6 +301,7 @@ struct BuildSetup {
 	bool appleEmbedded = false;        ///< Whether the build will target iOS or tvOS instead of macOS.
 	bool useXCFramework = false;       ///< Whether to use Apple XCFrameworks instead of static libraries
 	bool useVcpkg = false;             ///< Whether to load libraries from vcpkg or SCUMMVM_LIBS
+	bool useSlnx = false;              ///< Whether to use old .sln or new .slnx format
 	bool win32 = false;                ///< Target is Windows
 
 	bool featureEnabled(const std::string &feature) const;
diff --git a/devtools/create_project/msvc.cpp b/devtools/create_project/msvc.cpp
index 5a866d9b1c3..f29092cd8be 100644
--- a/devtools/create_project/msvc.cpp
+++ b/devtools/create_project/msvc.cpp
@@ -139,6 +139,13 @@ std::string MSVCProvider::outputLibraryDependencies(const BuildSetup &setup, boo
 }
 
 void MSVCProvider::createWorkspace(const BuildSetup &setup) {
+	if (setup.useSlnx)
+		createWorkspaceXml(setup);
+	else
+		createWorkspaceClassic(setup);
+}
+
+void MSVCProvider::createWorkspaceClassic(const BuildSetup &setup) {
 	UUIDMap::const_iterator svmUUID = _allProjUuidMap.find(setup.projectName);
 	if (svmUUID == _allProjUuidMap.end())
 		error("No UUID for \"" + setup.projectName + "\" project created");
@@ -211,6 +218,51 @@ void MSVCProvider::createWorkspace(const BuildSetup &setup) {
 	         << "EndGlobal\n";
 }
 
+void MSVCProvider::createWorkspaceXml(const BuildSetup &setup) {
+	const auto svmUUID = _allProjUuidMap.find(setup.projectName);
+	if (svmUUID == _allProjUuidMap.end())
+		error("No UUID for \"" + setup.projectName + "\" project created");
+
+	const std::string &svmProjectUUID = svmUUID->second;
+	assert(!svmProjectUUID.empty());
+	
+	std::ofstream solution((setup.outputDir + '/' + setup.projectName + ".slnx").c_str());
+	if (!solution || !solution.is_open()) {
+		error("Could not open \"" + setup.outputDir + '/' + setup.projectName + ".slnx\" for writing");
+		return;
+	}
+
+	solution << "<Solution>\n";
+
+	solution << "\t<Configurations>\n";
+
+	solution << "\t\t<BuildType Name=\"ASan\" />\n";
+	solution << "\t\t<BuildType Name=\"Debug\" />\n";
+	solution << "\t\t<BuildType Name=\"LLVM\" />\n";
+	solution << "\t\t<BuildType Name=\"Release\" />\n";
+	
+	for (const auto &arch : _archs) {
+		solution << "\t\t<Platform Name=\"" << getMSVCConfigName(arch) << "\" />\n"; 
+	}
+	solution << "\t</Configurations>\n";
+
+	// Write main project
+	if (!setup.devTools) {
+		solution << "\t<Project Path=\"" << setup.projectName << getProjectExtension()
+			<< "\" Id=\"" << svmProjectUUID << "\" "
+			<< " DefaultStartup=\"true\""  /* DefaultStartup has no effect in VS2022, needs VS2026+ */
+			<< " />\n";
+	}
+
+	for (const auto &engineUuid : _engineUuidMap) {
+		solution << "\t<Project Path=\"" << engineUuid.first << getProjectExtension()
+			<< "\" Id=\"" << engineUuid.second
+			<< "\" />\n";
+	}
+	
+	solution << "</Solution>\n";
+}
+
 void MSVCProvider::createOtherBuildFiles(const BuildSetup &setup) {
 	// Create the global property file
 	createGlobalProp(setup);
diff --git a/devtools/create_project/msvc.h b/devtools/create_project/msvc.h
index 0de4b432fe1..b055f8602aa 100644
--- a/devtools/create_project/msvc.h
+++ b/devtools/create_project/msvc.h
@@ -55,6 +55,8 @@ protected:
 	std::string outputLibraryDependencies(const BuildSetup &setup, bool isRelease) const;
 
 	void createWorkspace(const BuildSetup &setup) override;
+	void createWorkspaceClassic(const BuildSetup &setup);
+	void createWorkspaceXml(const BuildSetup &setup);
 
 	void createOtherBuildFiles(const BuildSetup &setup) override;
 




More information about the Scummvm-git-logs mailing list