From 1752f2a61b4c70501c5664ea945735e1e021f2d0 Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Fri, 29 Nov 2024 10:02:49 +0000 Subject: [PATCH] CMmakeLists.txt: add pico2 variant target naming --- CMakeLists.txt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 759aeaf..43eb97d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,12 +51,20 @@ target_compile_definitions (debugprobe PRIVATE option (DEBUG_ON_PICO "Compile firmware for the Pico instead of Debug Probe" OFF) if (DEBUG_ON_PICO) - target_compile_definitions (debugprobe PRIVATE + target_compile_definitions (debugprobe PRIVATE DEBUG_ON_PICO=1 ) - set_target_properties(debugprobe PROPERTIES - OUTPUT_NAME "debugprobe_on_pico" - ) + if (PICO_BOARD STREQUAL "pico") + set_target_properties(debugprobe PROPERTIES + OUTPUT_NAME "debugprobe_on_pico" + ) + elseif (PICO_BOARD STREQUAL "pico2") + set_target_properties(debugprobe PROPERTIES + OUTPUT_NAME "debugprobe_on_pico2" + ) + else () + error("Unsupported board ${PICO_BOARD}" PICO_BOARD) + endif () endif ()