经过3天的浴血奋战,终于搞清楚这两个的开发环境搭建,安装方法省略,直接干活,核心设置:
MAC 的核心设置:
CMakeList.txt 文件配置:
# The following lines of boilerplate have to be in your project's CMakeLists
# in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
set(PYTHON "/Users/linux/.espressif/python_env/idf4.2_py3.11_env/bin/python")
set(python "/Users/linux/.espressif/python_env/idf4.2_py3.11_env/bin/python")
# 不加这句默认为 'esp32'
set(IDF_TARGET "esp32")
set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/bluetooth/esp_ble_mesh/common_components/example_init)
set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(ble_mesh_provisioner)
MAC里的位置:
/Users/linux/esp/esp-idf/tools/cmake/toolchain-esp32.cmake
toolchian-esp32.cmake 设置:
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_C_COMPILER /Users/linux/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc)
set(CMAKE_CXX_COMPILER /Users/linux/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++)
set(CMAKE_ASM_COMPILER /Users/linux/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc)
set(CMAKE_C_FLAGS "-mlongcalls -Wno-frame-address" CACHE STRING "C Compiler Base Flags")
set(CMAKE_CXX_FLAGS "-mlongcalls -Wno-frame-address" CACHE STRING "C++ Compiler Base Flags")
WINDOWS 的核心设置:
关于软件的安装,环境变量的设置,已经有很多文章写过了,再此就不在赘述了。感谢大家的支持,什么问题可以留言给我。