Skip to content

Commit

Permalink
Got rid of the ignore return prefix/suffix and added shell wrapper sc…
Browse files Browse the repository at this point in the history
…ripts.
  • Loading branch information
pboechat committed Nov 15, 2023
1 parent 08d5a7f commit c1e84e3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
8 changes: 0 additions & 8 deletions cmake/fastcg_setup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion cmake/fastcg_targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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/$<LOWER_CASE:$<CONFIG>>/${ARGV0}-$<LOWER_CASE:$<CONFIG>>.apk
DEPENDS ${ARGV0}_BUILD_APK
)
Expand Down
3 changes: 3 additions & 0 deletions shell_wrapper.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
cmd /C %1
exit /B 0
3 changes: 3 additions & 0 deletions shell_wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
sh -c $1
exit 0

0 comments on commit c1e84e3

Please sign in to comment.