I added a CMakeLists.txt file for the parson component
Code: Select all
set(ROOT_PATH
${CMAKE_CURRENT_LIST_DIR}/../../..
)
idf_component_register(
SRCS ${ROOT_PATH}/libs/parson/parson.c
INCLUDE_DIRS ${ROOT_PATH}/libs/parson
)
Code: Select all
idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS "${include_dirs}"
REQUIRES app_update esp_https_ota bt littlefs console freertos nvs_flash coreMQTT azure-sdk-for-c azure-iot-middleware-freertos azure-iot parson
EMBED_TXTFILES ${project_dir}/server_certs/ca_cert.pem)
If I try to build/flash from the command pallette of vscode, I get this:
Failed to resolve component littlefs? That makes no sense. However, if I run shift+ctrl+B to build, which runs "idf.py build", it runs and compiles just fine. After I do this, THEN I can use the command palette to build and flash, even after I make minor code changes. If I make a change to something related to cmake, or make a git transaction, I have to force rebuild everything first.> Executing task: ninja <
[0/1] Re-running CMake...
-- Building ESP-IDF components for target esp32
CMake Error at C:/Users/Ricky/esp/esp-idf/tools/cmake/build.cmake:191 (message):
Failed to resolve component 'littlefs'.
Call Stack (most recent call first):
C:/Users/Ricky/esp/esp-idf/tools/cmake/build.cmake:217 (__build_resolve_and_add_req)
C:/Users/Ricky/esp/esp-idf/tools/cmake/build.cmake:441 (__build_expand_requirements)
C:/Users/Ricky/esp/esp-idf/tools/cmake/project.cmake:399 (idf_build_process)
CMakeLists.txt:13 (project)
-- Configuring incomplete, errors occurred!
See also "C:/repos/ESPfw2/controller-firmware/build/CMakeFiles/CMakeOutput.log".
←[31mFAILED: ←[0mbuild.ninja
C:\Users\Ricky\.espressif\tools\cmake\3.16.4\bin\cmake.exe -SC:\repos\ESPfw2\controller-firmware -BC:\repos\ESPfw2\controller-firmware\build
ninja: error: rebuilding 'build.ninja': subcommand failed
The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command ninja " terminated with exit code: 1.
If I remove parson as a component, everything goes back to normal. I can build from clean using command palette, and when I do a git commit or other git action, I'm not required to rebuild from scratch. It's really weird. Any ideas why this is happening?