Skip to content

Commit

Permalink
Add cmake configuration for pico vscode extension
Browse files Browse the repository at this point in the history
  • Loading branch information
shermp committed Oct 31, 2024
1 parent 3f86e2c commit b686d73
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# == DO NEVER EDIT THE NEXT LINES for Raspberry Pi Pico VS Code Extension to work ==
if(WIN32)
set(USERHOME $ENV{USERPROFILE})
else()
set(USERHOME $ENV{HOME})
endif()
set(sdkVersion 2.0.0)
set(toolchainVersion 13_2_Rel1)
set(picotoolVersion 2.0.0)
set(picoVscode ${USERHOME}/.pico-sdk/cmake/pico-vscode.cmake)
if (EXISTS ${picoVscode})
include(${picoVscode})
endif()
# ====================================================================================
cmake_minimum_required(VERSION 3.13)

SET(CMAKE_CXX_FLAGS_RELEASE "-O2")
Expand Down Expand Up @@ -52,9 +66,9 @@ set(ASHA_SRC

set_source_files_properties(${ASHA_SRC} PROPERTIES COMPILE_OPTIONS "-Wall;-Wextra;-Werror")

add_executable(pico-asha ${ASHA_SRC})
add_executable(pico_asha ${ASHA_SRC})

target_include_directories(pico-asha PUBLIC src/ lib/)
target_include_directories(pico_asha PUBLIC src/ lib/)

option(ENABLE_BLE_AD_DUMP "Enable dumping of advertisement packet data" OFF)
option(ENABLE_UAC2_LOG "Enable USB logging" OFF)
Expand All @@ -63,8 +77,8 @@ option(ENABLE_PAIR_DEL "Delete all HA pairings" OFF)
list(APPEND pico_asha_defines "PICO_ASHA_VERS=\"${PICO_ASHA_VERSION}\"")

list(APPEND pico_asha_defines "PICO_STDIO_USB_ENABLE_RESET_VIA_BAUD_RATE=1")
pico_enable_stdio_usb(pico-asha 1)
pico_enable_stdio_uart(pico-asha 1)
pico_enable_stdio_usb(pico_asha 1)
pico_enable_stdio_uart(pico_asha 1)

list(APPEND pico_asha_defines "PICO_FLASH_BANK_TOTAL_SIZE=(FLASH_SECTOR_SIZE * 8u)")

Expand All @@ -84,14 +98,14 @@ include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-Wdeprecated-enum-enum-conversion HAVE_DEP_ENNUM_ENUM_CONV)

if (HAVE_DEP_ENNUM_ENUM_CONV)
target_compile_options(pico-asha PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-enum-enum-conversion>)
target_compile_options(pico_asha PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-enum-enum-conversion>)
endif (HAVE_DEP_ENNUM_ENUM_CONV)

target_compile_definitions(pico-asha PUBLIC ${pico_asha_defines})
target_compile_definitions(pico_asha PUBLIC ${pico_asha_defines})

pico_add_extra_outputs(pico-asha)
pico_add_extra_outputs(pico_asha)

target_link_libraries(pico-asha
target_link_libraries(pico_asha
pico_stdlib
pico_btstack_ble
pico_btstack_cyw43
Expand All @@ -103,4 +117,4 @@ target_link_libraries(pico-asha
ArduinoJson
)

target_link_options(pico-asha PUBLIC -Wl,--print-memory-usage)
target_link_options(pico_asha PUBLIC -Wl,--print-memory-usage)

0 comments on commit b686d73

Please sign in to comment.