support optionally specifying where the path for the old RPi 1 tools is (-DWITH_RPI_ARM_TOOLS=/path/to/tools);

pull/23/head
Bryan Biedenkapp 3 years ago
parent c41491885f
commit 60fa32dc5d

@ -315,17 +315,31 @@ if (CROSS_COMPILE_AARCH64)
else () else ()
message(CHECK_PASS "no") message(CHECK_PASS "no")
endif (CROSS_COMPILE_AARCH64) endif (CROSS_COMPILE_AARCH64)
option(WITH_RPI_ARM_TOOLS "Specifies the location for the RPI ARM tools" off)
if (WITH_RPI_ARM_TOOLS)
set(RPI_ARM_TOOLS ${WITH_RPI_ARM_TOOLS})
message(CHECK_START "With RPi 1 Tools: ${RPI_ARM_TOOLS}")
endif (WITH_RPI_ARM_TOOLS)
message(CHECK_START "Cross compiling for (old RPi) 32-bit ARM") message(CHECK_START "Cross compiling for (old RPi) 32-bit ARM")
if (CROSS_COMPILE_RPI_ARM) if (CROSS_COMPILE_RPI_ARM)
message("Cloning legacy Raspberry Pi compilation toolchain")
Include(FetchContent) if (NOT WITH_RPI_ARM_TOOLS)
FetchContent_Declare( message("-- Cloning legacy Raspberry Pi compilation toolchain")
RPiTools Include(FetchContent)
GIT_REPOSITORY https://github.com/raspberrypi/tools.git FetchContent_Declare(
) RPiTools
FetchContent_MakeAvailable(RPiTools) GIT_REPOSITORY https://github.com/raspberrypi/tools.git
set(CMAKE_C_COMPILER ${CMAKE_CURRENT_LIST_DIR}/_deps/rpitools-src/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc) )
set(CMAKE_CXX_COMPILER ${CMAKE_CURRENT_LIST_DIR}/_deps/rpitools-src/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++) FetchContent_MakeAvailable(RPiTools)
set(CMAKE_C_COMPILER ${CMAKE_CURRENT_BINARY_DIR}/_deps/rpitools-src/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER ${CMAKE_CURRENT_BINARY_DIR}/_deps/rpitools-src/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++)
else()
set(CMAKE_C_COMPILER ${RPI_ARM_TOOLS}/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER ${RPI_ARM_TOOLS}/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++)
endif ()
set(ARCH armhf) set(ARCH armhf)
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE armhf) set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE armhf)
message(CHECK_PASS "yes") message(CHECK_PASS "yes")

Loading…
Cancel
Save

Powered by TurnKey Linux.