From c1e84e3b1b3a85c59afc60d3e3ec462f1a434fba Mon Sep 17 00:00:00 2001 From: Pedro Boechat Date: Wed, 15 Nov 2023 14:44:42 +0000 Subject: [PATCH] Got rid of the ignore return prefix/suffix and added shell wrapper scripts. --- cmake/fastcg_setup.cmake | 8 -------- cmake/fastcg_targets.cmake | 2 +- shell_wrapper.bat | 3 +++ shell_wrapper.sh | 3 +++ 4 files changed, 7 insertions(+), 9 deletions(-) create mode 100644 shell_wrapper.bat create mode 100644 shell_wrapper.sh diff --git a/cmake/fastcg_setup.cmake b/cmake/fastcg_setup.cmake index 6c457bda..63221d5c 100644 --- a/cmake/fastcg_setup.cmake +++ b/cmake/fastcg_setup.cmake @@ -9,14 +9,6 @@ if(NOT FASTCG_PLATFORM IN_LIST FASTCG_PLATFORMS) endif() message(STATUS "FastCG platform: ${FASTCG_PLATFORM}") -if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") - set(FASTCG_IGNORE_RETURN_PREFIX cmd /C) - set(FASTCG_IGNORE_RETURN_SUFFIX || exit 0) -else() - set(FASTCG_IGNORE_RETURN_PREFIX sh -c) - set(FASTCG_IGNORE_RETURN_SUFFIX || true) -endif() - # Setup graphics system set(FASTCG_GRAPHICS_SYSTEM "OpenGL" CACHE STRING "FastCG graphics system") diff --git a/cmake/fastcg_targets.cmake b/cmake/fastcg_targets.cmake index 2bd30663..baa42068 100644 --- a/cmake/fastcg_targets.cmake +++ b/cmake/fastcg_targets.cmake @@ -247,7 +247,7 @@ function(_fastcg_add_apk_targets) add_custom_target( ${ARGV0}_DEPLOY_APK COMMAND ${FASTCG_ADB} shell am force-stop com.fastcg.${ARGV0} - COMMAND ${FASTCG_IGNORE_RETURN_PREFIX} ${FASTCG_ADB} uninstall com.fastcg.${ARGV0} ${FASTCG_IGNORE_RETURN_SUFFIX} + COMMAND ${CMAKE_SOURCE_DIR}/shell_wrapper "${FASTCG_ADB} uninstall com.fastcg.${ARGV0}" COMMAND ${FASTCG_ADB} install ${DST_GRADLE_PROJECT_DIR}/app/build/outputs/apk/$>/${ARGV0}-$>.apk DEPENDS ${ARGV0}_BUILD_APK ) diff --git a/shell_wrapper.bat b/shell_wrapper.bat new file mode 100644 index 00000000..b47e3c71 --- /dev/null +++ b/shell_wrapper.bat @@ -0,0 +1,3 @@ +@echo off +cmd /C %1 +exit /B 0 \ No newline at end of file diff --git a/shell_wrapper.sh b/shell_wrapper.sh new file mode 100644 index 00000000..874b7b08 --- /dev/null +++ b/shell_wrapper.sh @@ -0,0 +1,3 @@ +#!/bin/bash +sh -c $1 +exit 0 \ No newline at end of file