From fc28845fb9580f82cb7bd783f02b6ee3193c0b17 Mon Sep 17 00:00:00 2001 From: Angus Logan Date: Mon, 19 Jun 2023 10:08:57 +0100 Subject: [PATCH] * Fix out of box failure when ARM toolchain is not in path - Use pico_find_compiler to find linker --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8322b7a6..5718ada7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,8 @@ set(CMAKE_CXX_STANDARD 17) # Initialize the SDK pico_sdk_init() +pico_find_compiler(PICO_COMPILER_LD ${PICO_GCC_TRIPLE}-ld) + function(add_resource target file) get_filename_component(NAME ${ARGV1} NAME_WE) set(FILENAME ${ARGV1}) @@ -21,7 +23,7 @@ function(add_resource target file) ${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME} ${CMAKE_CURRENT_BINARY_DIR} - COMMAND arm-none-eabi-ld -r -b binary -o ${NAME}.o ${FILENAME} + COMMAND ${PICO_COMPILER_LD} -r -b binary -o ${NAME}.o ${FILENAME} DEPENDS ${FILENAME} )