Expose platform checks as CMake targets

This commit is contained in:
2026-06-05 12:47:32 +02:00
parent 1dc2ae4f21
commit 97fd7de955
10 changed files with 95 additions and 27 deletions

View File

@@ -30,6 +30,12 @@ REQUIRED_ANDROID_PRESETS = [
"android-focus-arm64",
]
EXPECTED_CMAKE_PLATFORM_TARGETS = [
"panopainter_platform_build_headless",
"panopainter_platform_build_android_assets",
"panopainter_platform_build_apple_remote",
]
def repo_root() -> Path:
return Path(__file__).resolve().parents[2]
@@ -96,6 +102,12 @@ def main() -> int:
sh_targets = shell_default_targets(root)
ps_presets = powershell_default_presets(root)
sh_presets = shell_default_presets(root)
cmake_platform_module = (root / "cmake" / "PanoPainterPlatformTargets.cmake").read_text(encoding="utf-8")
root_cmake = (root / "CMakeLists.txt").read_text(encoding="utf-8")
cmake_platform_targets_present = {
target: target in cmake_platform_module for target in EXPECTED_CMAKE_PLATFORM_TARGETS
}
cmake_platform_module_included = "include(PanoPainterPlatformTargets)" in root_cmake
result = {
"ok": True,
@@ -107,6 +119,8 @@ def main() -> int:
"platform-build.ps1": ps_presets,
"platform-build.sh": sh_presets,
},
"cmakePlatformTargetsPresent": cmake_platform_targets_present,
"cmakePlatformModuleIncluded": cmake_platform_module_included,
"missing": {
"platform-build.ps1.targets": missing(expected, ps_targets),
"platform-build.sh.targets": missing(expected, sh_targets),
@@ -114,7 +128,11 @@ def main() -> int:
"platform-build.sh.presets": missing(REQUIRED_ANDROID_PRESETS, sh_presets),
},
}
result["ok"] = all(not values for values in result["missing"].values())
result["ok"] = (
all(not values for values in result["missing"].values())
and all(cmake_platform_targets_present.values())
and cmake_platform_module_included
)
print(json.dumps(result, separators=(",", ":")))
return 0 if result["ok"] else 1