From 6a7d881258a3977bdbd166d4f63c1fb405ee91b2 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Thu, 11 Nov 2021 21:37:29 -0500 Subject: [PATCH] Fix CI --- cmake/base-toolchain.cmake | 42 ++++++++++++++++----------------- scripts/install-dependencies.sh | 1 + 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/cmake/base-toolchain.cmake b/cmake/base-toolchain.cmake index fd5825b1b..08a50724e 100644 --- a/cmake/base-toolchain.cmake +++ b/cmake/base-toolchain.cmake @@ -1,6 +1,20 @@ +# Sanity Check Return +function(sanity_check_return ret) + if(NOT ret EQUAL "0") + message(FATAL_ERROR "Process Failed") + endif() +endfunction() + # Get Host Architecture find_program(UNAME uname /bin /usr/bin /usr/local/bin REQUIRED) -execute_process(COMMAND "${UNAME}" "-m" OUTPUT_VARIABLE HOST_ARCHITECTURE ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) +execute_process( + COMMAND "${UNAME}" "-m" + OUTPUT_VARIABLE HOST_ARCHITECTURE + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE ret +) +sanity_check_return("${ret}") # Get Include Directories function(get_include_dirs target compiler result) @@ -16,7 +30,9 @@ function(get_include_dirs target compiler result) ERROR_QUIET OUTPUT_VARIABLE tool OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE ret ) + sanity_check_return("${ret}") # Run Tool To Get Include Path set(tool_output "") @@ -26,7 +42,9 @@ function(get_include_dirs target compiler result) ERROR_VARIABLE tool_output ERROR_STRIP_TRAILING_WHITESPACE INPUT_FILE "/dev/null" + RESULT_VARIABLE ret ) + sanity_check_return("${ret}") string(REPLACE "\n" ";" tool_output "${tool_output}") # Loop @@ -61,30 +79,10 @@ function(get_include_dirs target compiler result) set("${result}" "${${result}}" PARENT_SCOPE) endfunction() -# Get GCC Prefix -function(get_gcc_prefix target result) - # Get Default Target - set("${result}" "" PARENT_SCOPE) - set(output "") - execute_process( - COMMAND "gcc" "-dumpmachine" - ERROR_QUIET - OUTPUT_VARIABLE output - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - - # Check - if(NOT output STREQUAL target) - set("${result}" "${target}-" PARENT_SCOPE) - endif() -endfunction() - # Setup Include Directories function(setup_include_dirs compiler target result) # Get Full Compiler - set(prefix "") - get_gcc_prefix("${target}" prefix) - set(full_compiler "${prefix}${compiler}") + set(full_compiler "${target}-${compiler}") # Get Include Directories set(include_dirs "") diff --git a/scripts/install-dependencies.sh b/scripts/install-dependencies.sh index 003b86f4a..53a44bbab 100755 --- a/scripts/install-dependencies.sh +++ b/scripts/install-dependencies.sh @@ -31,6 +31,7 @@ sudo apt-get install --no-install-recommends -y \ libfreeimage3 libfreeimage-dev \ crossbuild-essential-armhf \ crossbuild-essential-arm64 \ + gcc \ libopenal-dev \ qemu-user-static