feat: Update CMake presets for Unix compatibility

- Added a new hidden preset for Unix/macOS/Linux builds using Makefiles.
- Updated existing presets to inherit from the new Unix preset, ensuring consistent configuration across platforms.
- Revised inheritance for macOS and Linux debug and release builds to include Unix settings, enhancing cross-platform compatibility.
This commit is contained in:
scawful
2025-10-04 22:55:25 -04:00
parent 7be949b30f
commit 39edadb7b6

View File

@@ -10,7 +10,6 @@
"name": "_base", "name": "_base",
"hidden": true, "hidden": true,
"description": "Base preset with common settings", "description": "Base preset with common settings",
"generator": "Unix Makefiles",
"binaryDir": "${sourceDir}/build", "binaryDir": "${sourceDir}/build",
"cacheVariables": { "cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON", "CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
@@ -22,6 +21,17 @@
"YAZE_USE_MODULAR_BUILD": "ON" "YAZE_USE_MODULAR_BUILD": "ON"
} }
}, },
{
"name": "_unix",
"hidden": true,
"description": "Unix/macOS/Linux base with Makefiles",
"generator": "Unix Makefiles",
"condition": {
"type": "notEquals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{ {
"name": "_quiet", "name": "_quiet",
"hidden": true, "hidden": true,
@@ -70,7 +80,7 @@
"name": "mac-dbg", "name": "mac-dbg",
"displayName": "macOS Debug (ARM64)", "displayName": "macOS Debug (ARM64)",
"description": "macOS ARM64 debug build (warnings off)", "description": "macOS ARM64 debug build (warnings off)",
"inherits": ["_base", "_mac", "_quiet"], "inherits": ["_base", "_unix", "_mac", "_quiet"],
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug", "CMAKE_BUILD_TYPE": "Debug",
"CMAKE_OSX_ARCHITECTURES": "arm64" "CMAKE_OSX_ARCHITECTURES": "arm64"
@@ -80,7 +90,7 @@
"name": "mac-dbg-v", "name": "mac-dbg-v",
"displayName": "macOS Debug Verbose (ARM64)", "displayName": "macOS Debug Verbose (ARM64)",
"description": "macOS ARM64 debug build with all warnings", "description": "macOS ARM64 debug build with all warnings",
"inherits": ["_base", "_mac", "_verbose"], "inherits": ["_base", "_unix", "_mac", "_verbose"],
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug", "CMAKE_BUILD_TYPE": "Debug",
"CMAKE_OSX_ARCHITECTURES": "arm64" "CMAKE_OSX_ARCHITECTURES": "arm64"
@@ -90,7 +100,7 @@
"name": "mac-rel", "name": "mac-rel",
"displayName": "macOS Release (ARM64)", "displayName": "macOS Release (ARM64)",
"description": "macOS ARM64 release build (warnings off)", "description": "macOS ARM64 release build (warnings off)",
"inherits": ["_base", "_mac", "_quiet"], "inherits": ["_base", "_unix", "_mac", "_quiet"],
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Release", "CMAKE_BUILD_TYPE": "Release",
"CMAKE_OSX_ARCHITECTURES": "arm64", "CMAKE_OSX_ARCHITECTURES": "arm64",
@@ -123,8 +133,10 @@
"name": "mac-dev", "name": "mac-dev",
"displayName": "macOS Dev", "displayName": "macOS Dev",
"description": "macOS development with ROM tests", "description": "macOS development with ROM tests",
"inherits": "mac-dbg", "inherits": ["_base", "_unix", "_mac", "_quiet"],
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_OSX_ARCHITECTURES": "arm64",
"YAZE_ENABLE_ROM_TESTS": "ON", "YAZE_ENABLE_ROM_TESTS": "ON",
"YAZE_TEST_ROM_PATH": "${sourceDir}/zelda3.sfc" "YAZE_TEST_ROM_PATH": "${sourceDir}/zelda3.sfc"
} }
@@ -252,7 +264,7 @@
"name": "lin-dbg", "name": "lin-dbg",
"displayName": "Linux Debug", "displayName": "Linux Debug",
"description": "Linux debug build with GCC (warnings off)", "description": "Linux debug build with GCC (warnings off)",
"inherits": ["_base", "_quiet"], "inherits": ["_base", "_unix", "_quiet"],
"condition": { "condition": {
"type": "equals", "type": "equals",
"lhs": "${hostSystemName}", "lhs": "${hostSystemName}",
@@ -268,7 +280,7 @@
"name": "lin-clang", "name": "lin-clang",
"displayName": "Linux Clang", "displayName": "Linux Clang",
"description": "Linux debug build with Clang (warnings off)", "description": "Linux debug build with Clang (warnings off)",
"inherits": ["_base", "_quiet"], "inherits": ["_base", "_unix", "_quiet"],
"condition": { "condition": {
"type": "equals", "type": "equals",
"lhs": "${hostSystemName}", "lhs": "${hostSystemName}",
@@ -284,7 +296,7 @@
"name": "ci", "name": "ci",
"displayName": "9. CI Build", "displayName": "9. CI Build",
"description": "Continuous integration build (no ROM tests)", "description": "Continuous integration build (no ROM tests)",
"inherits": ["_base", "_quiet"], "inherits": ["_base", "_unix", "_quiet"],
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo", "CMAKE_BUILD_TYPE": "RelWithDebInfo",
"YAZE_ENABLE_ROM_TESTS": "OFF", "YAZE_ENABLE_ROM_TESTS": "OFF",
@@ -295,7 +307,7 @@
"name": "asan", "name": "asan",
"displayName": "8. AddressSanitizer", "displayName": "8. AddressSanitizer",
"description": "Debug build with AddressSanitizer", "description": "Debug build with AddressSanitizer",
"inherits": "_base", "inherits": ["_base", "_unix"],
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug", "CMAKE_BUILD_TYPE": "Debug",
"CMAKE_CXX_FLAGS": "-fsanitize=address -fno-omit-frame-pointer -g", "CMAKE_CXX_FLAGS": "-fsanitize=address -fno-omit-frame-pointer -g",
@@ -308,7 +320,7 @@
"name": "coverage", "name": "coverage",
"displayName": "7. Coverage", "displayName": "7. Coverage",
"description": "Debug build with code coverage", "description": "Debug build with code coverage",
"inherits": "_base", "inherits": ["_base", "_unix"],
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug", "CMAKE_BUILD_TYPE": "Debug",
"CMAKE_CXX_FLAGS": "--coverage -g -O0", "CMAKE_CXX_FLAGS": "--coverage -g -O0",