[Scummvm-git-logs] scummvm master -> 070366111537100855ee21061ff2ef2d30827de6

bluegr noreply at scummvm.org
Wed Jan 8 17:30:39 UTC 2025


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

Summary:
e02cd501cc CREATE_PROJECT: Move features hard-coded logic in its own function
0703661115 CREATE_PROJECT: Add support for meta-components


Commit: e02cd501cce8894cd74482a6416c7fac786a8bd1
    https://github.com/scummvm/scummvm/commit/e02cd501cce8894cd74482a6416c7fac786a8bd1
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-01-08T19:30:35+02:00

Commit Message:
CREATE_PROJECT: Move features hard-coded logic in its own function

And accept these are not hacks anymore.

Changed paths:
    devtools/create_project/create_project.cpp


diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index 5ae9a7f0b55..3a48edc578d 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -104,6 +104,8 @@ enum ProjectType {
 
 std::map<std::string, bool> isEngineEnabled;
 
+static void fixupFeatures(ProjectType projectType, BuildSetup &setup);
+
 int main(int argc, char *argv[]) {
 #ifndef USE_WIN32_API
 	// Initialize random number generator for UUID creation
@@ -329,7 +331,7 @@ int main(int argc, char *argv[]) {
 		}
 	}
 
-	// When building tests, disable some features
+	// When building tests, disable some features and all engines
 	if (setup.tests) {
 		setup.useStaticDetection = false;
 		setFeatureBuildState("mt32emu", setup.features, false);
@@ -345,46 +347,7 @@ int main(int argc, char *argv[]) {
 		setup.useStaticDetection = false;
 	}
 
-	// HACK: Vorbis and Tremor can not be enabled simultaneously
-	if (getFeatureBuildState("tremor", setup.features)) {
-		setFeatureBuildState("vorbis", setup.features, false);
-	}
-
-	// HACK: Fluidsynth and Fluidlite can not be enabled simultaneously
-	if (getFeatureBuildState("fluidlite", setup.features)) {
-		setFeatureBuildState("fluidsynth", setup.features, false);
-	}
-
-	// HACK: OpenMPT and Mikmod can not be enabled simultaneously
-	if (getFeatureBuildState("openmpt", setup.features)) {
-		setFeatureBuildState("mikmod", setup.features, false);
-	}
-
-	// HACK: These features depend on OpenGL
-	if (!getFeatureBuildState("opengl", setup.features)) {
-		setFeatureBuildState("opengl_game_classic", setup.features, false);
-		setFeatureBuildState("opengl_game_shaders", setup.features, false);
-	}
-
-	// HACK: Check IMGUI dependencies
-	if (!getFeatureBuildState("opengl", setup.features) ||
-		!getFeatureBuildState("freetype2", setup.features) ||
-		!setup.useSDL2) {
-		std::cerr << "WARNING: imgui requires opengl, freetype2 and sdl2\n";
-		setFeatureBuildState("imgui", setup.features, false);
-	}
-	// HACK: IMGUI is not available on Xcode
-#ifdef ENABLE_XCODE
-	if (projectType == kProjectXcode) {
-		setFeatureBuildState("imgui", setup.features, false);
-	}
-#endif
-
-	// Calculate 3D feature state
-	setFeatureBuildState("3d", setup.features,
-			getFeatureBuildState("tinygl", setup.features) ||
-			getFeatureBuildState("opengl_game_classic", setup.features) ||
-			getFeatureBuildState("opengl_game_shaders", setup.features));
+	fixupFeatures(projectType, setup);
 
 	// Disable engines for which we are missing dependencies and mark components as needed
 	for (EngineDescList::const_iterator i = setup.engines.begin(); i != setup.engines.end(); ++i) {
@@ -1288,6 +1251,55 @@ FeatureList getAllFeatures() {
 	return features;
 }
 
+/**
+ * Apply all the hardcoded logic for the features availability.
+ *
+ * This means disabling conflicting features, enabling meta-features, ...
+ */
+static void fixupFeatures(ProjectType projectType, BuildSetup &setup) {
+	// Vorbis and Tremor can not be enabled simultaneously
+	if (getFeatureBuildState("tremor", setup.features)) {
+		setFeatureBuildState("vorbis", setup.features, false);
+	}
+
+	// Fluidsynth and Fluidlite can not be enabled simultaneously
+	if (getFeatureBuildState("fluidlite", setup.features)) {
+		setFeatureBuildState("fluidsynth", setup.features, false);
+	}
+
+	// OpenMPT and Mikmod can not be enabled simultaneously
+	if (getFeatureBuildState("openmpt", setup.features)) {
+		setFeatureBuildState("mikmod", setup.features, false);
+	}
+
+	// These features depend on OpenGL
+	if (!getFeatureBuildState("opengl", setup.features)) {
+		setFeatureBuildState("opengl_game_classic", setup.features, false);
+		setFeatureBuildState("opengl_game_shaders", setup.features, false);
+	}
+
+	// Check IMGUI dependencies
+	if (!getFeatureBuildState("opengl", setup.features) ||
+		!getFeatureBuildState("freetype2", setup.features) ||
+		!setup.useSDL2) {
+		std::cerr << "WARNING: imgui requires opengl, freetype2 and sdl2\n";
+		setFeatureBuildState("imgui", setup.features, false);
+	}
+	// IMGUI is not available on Xcode
+#ifdef ENABLE_XCODE
+	if (projectType == kProjectXcode) {
+		setFeatureBuildState("imgui", setup.features, false);
+	}
+#endif
+
+	// Calculate 3D feature state
+	setFeatureBuildState("3d", setup.features,
+			getFeatureBuildState("tinygl", setup.features) ||
+			getFeatureBuildState("opengl_game_classic", setup.features) ||
+			getFeatureBuildState("opengl_game_shaders", setup.features));
+
+}
+
 ComponentList getAllComponents(const std::string &srcDir, FeatureList &features) {
 	std::string configureFile = srcDir + "/configure";
 


Commit: 070366111537100855ee21061ff2ef2d30827de6
    https://github.com/scummvm/scummvm/commit/070366111537100855ee21061ff2ef2d30827de6
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-01-08T19:30:35+02:00

Commit Message:
CREATE_PROJECT: Add support for meta-components

These components represent a group of features which can be deleted as a
whole when unused.

Changed paths:
    devtools/create_project/create_project.cpp


diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index 3a48edc578d..4f8111df45e 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -105,6 +105,7 @@ enum ProjectType {
 std::map<std::string, bool> isEngineEnabled;
 
 static void fixupFeatures(ProjectType projectType, BuildSetup &setup);
+static void fixupComponents(BuildSetup &setup);
 
 int main(int argc, char *argv[]) {
 #ifndef USE_WIN32_API
@@ -398,6 +399,9 @@ int main(int argc, char *argv[]) {
 	// Disable unused features / components
 	disableComponents(setup.components);
 
+	// Handle hard-coded component logic
+	fixupComponents(setup);
+
 	// Print status
 	cout << "Enabled engines:\n\n";
 	for (EngineDescList::const_iterator i = setup.engines.begin(); i != setup.engines.end(); ++i) {
@@ -1370,6 +1374,37 @@ void disableComponents(const ComponentList &components) {
 	}
 }
 
+/**
+ * Apply all the hardcoded logic for the meta-components.
+ *
+ * This means disabling features not needed because their matching meta-component
+ * is not needed either
+ */
+static void fixupComponents(BuildSetup &setup) {
+	bool disabled = false;
+
+	// No MIDI, disable all MIDI implementations
+	if (!getFeatureBuildState("midi", setup.features)) {
+		disabled = true;
+		std::cout << "Disabling mt32emu, fluidsynth and fluidlite because MIDI is unused by enabled engines\n";
+		setFeatureBuildState("mt32emu",    setup.features, false);
+		setFeatureBuildState("fluidsynth", setup.features, false);
+		setFeatureBuildState("fluidlite",  setup.features, false);
+	}
+
+	// Not any tracker, disable all tracker implementations
+	if (!getFeatureBuildState("universaltracker", setup.features)) {
+		disabled = true;
+		std::cout << "Disabling MikMod and OpenMPT because Universal Tracker playback is unused by enabled engines\n";
+		setFeatureBuildState("mikmod",  setup.features, false);
+		setFeatureBuildState("openmpt", setup.features, false);
+	}
+
+	if (disabled) {
+		std::cout << "\n";
+	}
+}
+
 StringList getFeatureDefines(const FeatureList &features) {
 	StringList defines;
 




More information about the Scummvm-git-logs mailing list