Expose package checks as CMake targets

This commit is contained in:
2026-06-05 12:40:22 +02:00
parent 711a9b5037
commit 1dc2ae4f21
6 changed files with 98 additions and 7 deletions

View File

@@ -18,6 +18,13 @@ EXPECTED_PACKAGE_KINDS = [
"webgl",
]
EXPECTED_CMAKE_PACKAGE_TARGETS = [
"panopainter_package_readiness",
"panopainter_android_standard_native_package",
"panopainter_android_vr_native_package_configure",
"panopainter_android_native_package_smoke",
]
def repo_root() -> Path:
return Path(__file__).resolve().parents[2]
@@ -65,6 +72,8 @@ def main() -> int:
"package-smoke.ps1": r"retained-native-cmake-check",
"package-smoke.sh": r"retained-native-cmake-check",
})
cmake_package_module = (root / "cmake" / "PanoPainterPackageTargets.cmake").read_text(encoding="utf-8")
root_cmake = (root / "CMakeLists.txt").read_text(encoding="utf-8")
missing = {
"package-smoke.ps1": [kind for kind in expected if kind not in ps_kinds],
@@ -84,6 +93,10 @@ def main() -> int:
retained_android_native_complete = {
name: count >= 3 for name, count in retained_android_native_counts.items()
}
cmake_package_targets_present = {
target: target in cmake_package_module for target in EXPECTED_CMAKE_PACKAGE_TARGETS
}
cmake_package_module_included = "include(PanoPainterPackageTargets)" in root_cmake
ok = (
all(not values for values in missing.values())
@@ -92,6 +105,8 @@ def main() -> int:
and all(blocked_complete.values())
and all(readiness_mode_present.values())
and all(retained_android_native_complete.values())
and all(cmake_package_targets_present.values())
and cmake_package_module_included
)
print(json.dumps({
@@ -107,6 +122,8 @@ def main() -> int:
"blockedComplete": blocked_complete,
"readinessModePresent": readiness_mode_present,
"retainedAndroidNativeComplete": retained_android_native_complete,
"cmakePackageTargetsPresent": cmake_package_targets_present,
"cmakePackageModuleIncluded": cmake_package_module_included,
}, separators=(",", ":")))
return 0 if ok else 1