This commit is contained in:
TheBrokenRail 2022-08-10 17:21:38 -04:00
parent 4ab6b7aed1
commit 35cafec1ee
2 changed files with 3 additions and 6 deletions

View File

@ -1,7 +1,3 @@
# Locations
set(toolchain_dir "${CMAKE_CURRENT_BINARY_DIR}/prebuilt-armhf-toolchain")
set(sysroot_dir "${CMAKE_CURRENT_BINARY_DIR}/bundled-armhf-sysroot")
# Pick URL # Pick URL
execute_process(COMMAND uname -m OUTPUT_VARIABLE arch OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND uname -m OUTPUT_VARIABLE arch OUTPUT_STRIP_TRAILING_WHITESPACE)
if(arch STREQUAL "x86_64") if(arch STREQUAL "x86_64")
@ -21,10 +17,10 @@ FetchContent_Declare(
prebuilt-armhf-toolchain prebuilt-armhf-toolchain
URL "${toolchain_url}" URL "${toolchain_url}"
URL_HASH "SHA256=${toolchain_sha256}" URL_HASH "SHA256=${toolchain_sha256}"
SOURCE_DIR "${toolchain_dir}"
) )
FetchContent_MakeAvailable(prebuilt-armhf-toolchain) FetchContent_MakeAvailable(prebuilt-armhf-toolchain)
set(FETCHCONTENT_QUIET TRUE) set(FETCHCONTENT_QUIET TRUE)
set(toolchain_dir "${prebuilt-armhf-toolchain_SOURCE_DIR}")
# Force Toolchain # Force Toolchain
file(WRITE "${toolchain_dir}/toolchain.cmake" file(WRITE "${toolchain_dir}/toolchain.cmake"
@ -36,6 +32,7 @@ file(WRITE "${toolchain_dir}/toolchain.cmake"
set(CMAKE_TOOLCHAIN_FILE "${toolchain_dir}/toolchain.cmake" CACHE STRING "" FORCE) set(CMAKE_TOOLCHAIN_FILE "${toolchain_dir}/toolchain.cmake" CACHE STRING "" FORCE)
# Build Sysroot # Build Sysroot
set(sysroot_dir "${CMAKE_CURRENT_BINARY_DIR}/bundled-armhf-sysroot")
if("${toolchain_dir}/bin/arm-none-linux-gnueabihf-gcc" IS_NEWER_THAN "${sysroot_dir}") if("${toolchain_dir}/bin/arm-none-linux-gnueabihf-gcc" IS_NEWER_THAN "${sysroot_dir}")
# Create Directory # Create Directory
file(REMOVE_RECURSE "${sysroot_dir}") file(REMOVE_RECURSE "${sysroot_dir}")

@ -1 +1 @@
Subproject commit 07d0b89cddb833770627b3e81d79cd8dfaf00b43 Subproject commit 6c445538879f9e916f8e62723d2ac7cd77d96191