diff --git a/CMakeLists.txt b/CMakeLists.txt index a28be1d..cbeef09 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") @@ -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) @@ -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)") @@ -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 $<$:-Wno-deprecated-enum-enum-conversion>) + target_compile_options(pico_asha PRIVATE $<$:-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 @@ -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)