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

@@ -0,0 +1,23 @@
find_program(PP_POWERSHELL_COMMAND NAMES pwsh powershell)
function(pp_add_powershell_automation_target target_name)
cmake_parse_arguments(PP_AUTOMATION_TARGET "" "COMMENT" "ARGUMENTS" ${ARGN})
if(PP_POWERSHELL_COMMAND)
add_custom_target(${target_name}
COMMAND "${PP_POWERSHELL_COMMAND}"
-NoProfile
-ExecutionPolicy Bypass
${PP_AUTOMATION_TARGET_ARGUMENTS}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMENT "${PP_AUTOMATION_TARGET_COMMENT}"
USES_TERMINAL
VERBATIM)
else()
add_custom_target(${target_name}
COMMAND "${CMAKE_COMMAND}" -E echo "PowerShell was not found; cannot run ${target_name}."
COMMAND "${CMAKE_COMMAND}" -E false
COMMENT "${PP_AUTOMATION_TARGET_COMMENT}"
VERBATIM)
endif()
endfunction()

View File

@@ -1,26 +1,4 @@
find_program(PP_POWERSHELL_COMMAND NAMES pwsh powershell)
function(pp_add_powershell_automation_target target_name)
cmake_parse_arguments(PP_PACKAGE_TARGET "" "COMMENT" "ARGUMENTS" ${ARGN})
if(PP_POWERSHELL_COMMAND)
add_custom_target(${target_name}
COMMAND "${PP_POWERSHELL_COMMAND}"
-NoProfile
-ExecutionPolicy Bypass
${PP_PACKAGE_TARGET_ARGUMENTS}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMENT "${PP_PACKAGE_TARGET_COMMENT}"
USES_TERMINAL
VERBATIM)
else()
add_custom_target(${target_name}
COMMAND "${CMAKE_COMMAND}" -E echo "PowerShell was not found; cannot run ${target_name}."
COMMAND "${CMAKE_COMMAND}" -E false
COMMENT "${PP_PACKAGE_TARGET_COMMENT}"
VERBATIM)
endif()
endfunction()
include(PanoPainterAutomation)
pp_add_powershell_automation_target(panopainter_package_readiness
COMMENT "Report package readiness blockers."

View File

@@ -0,0 +1,19 @@
include(PanoPainterAutomation)
pp_add_powershell_automation_target(panopainter_platform_build_headless
COMMENT "Run the default headless platform build matrix."
ARGUMENTS
-File "${CMAKE_CURRENT_SOURCE_DIR}/scripts/automation/platform-build.ps1")
pp_add_powershell_automation_target(panopainter_platform_build_android_assets
COMMENT "Build Android root CMake asset component across standard/VR presets."
ARGUMENTS
-File "${CMAKE_CURRENT_SOURCE_DIR}/scripts/automation/platform-build.ps1"
-Presets android-arm64,android-x64,android-quest-arm64,android-focus-arm64
-Targets pp_assets)
pp_add_powershell_automation_target(panopainter_platform_build_apple_remote
COMMENT "Run remote Apple compile validation for macOS, iOS simulator, and iOS device."
ARGUMENTS
-File "${CMAKE_CURRENT_SOURCE_DIR}/scripts/automation/apple-remote-build.ps1"
-Presets macos,ios-simulator,ios-device)