From 61e44047076b0cb7064793e882bd4f00d15e2c26 Mon Sep 17 00:00:00 2001 From: David Antliff Date: Tue, 7 Apr 2020 12:07:18 +1200 Subject: [PATCH 1/3] Fix CMakeLists.txt for CMake variable changes in ESP-IDF v4.1-beta1 and newer. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e87312..051f8ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,4 +6,4 @@ include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(esp32-ds18b20-example) # Ignore false clang warnings about `struct foo = { 0 }` -target_compile_options(${IDF_PROJECT_EXECUTABLE} PRIVATE -Wno-missing-braces -Wmissing-field-initializers) +target_compile_options(${project_elf} PRIVATE -Wno-missing-braces -Wmissing-field-initializers) From 5a3f2244052d2390ed2fc2c842ea6c983e0972cb Mon Sep 17 00:00:00 2001 From: David Antliff Date: Tue, 7 Apr 2020 16:58:35 +1200 Subject: [PATCH 2/3] Add CMake logic to support both IDF v3.3 and v4.x. --- CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 051f8ec..31da009 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,5 +5,15 @@ cmake_minimum_required(VERSION 3.5) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(esp32-ds18b20-example) +if (NOT IDF_VERSION_MAJOR) + set(IDF_VERSION_MAJOR 3) +endif() + +if (IDF_VERSION_MAJOR GREATER 3) + set(PROJECT_ELF ${project_elf}) +else() + set(PROJECT_ELF ${IDF_PROJECT_EXECUTABLE}) +endif() + # Ignore false clang warnings about `struct foo = { 0 }` -target_compile_options(${project_elf} PRIVATE -Wno-missing-braces -Wmissing-field-initializers) +target_compile_options(${PROJECT_ELF} PRIVATE -Wno-missing-braces -Wmissing-field-initializers) From 912310eafdd53a269015cba5a3357fe5431285af Mon Sep 17 00:00:00 2001 From: David Antliff Date: Tue, 7 Apr 2020 17:20:27 +1200 Subject: [PATCH 3/3] Add TravisCI support for ESP-IDF v4.1-beta1. --- .travis.yml | 58 ++++++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4821e4b..397e57e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,33 +1,37 @@ +os: linux dist: bionic language: python python: "3.8" -before_install: - # Save path to the git respository - - PROJECT_PATH=$(pwd) +jobs: + include: + - stage: # IDF v3.3 + install: + # Install ESP32 toochain following steps as described + # in http://esp-idf.readthedocs.io/en/latest/linux-setup.html + # + # Download binary toolchain for the ESP32 + - pushd ~ + - wget https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz + - tar -xzf xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz + # Make xtensa-esp32-elf available for all terminal sessions + - export PATH=$PATH:$(pwd)/xtensa-esp32-elf/bin + # Get ESP-IDF from github + - git clone --recursive --branch v3.3 --single-branch --shallow-submodules https://github.com/espressif/esp-idf.git esp-idf + # Set the path to ESP-IDF directory + - export IDF_PATH=$(pwd)/esp-idf + # Install python dependencies + - pip install --requirement $IDF_PATH/requirements.txt + - popd + script: + - $IDF_PATH/tools/idf.py build -install: - # Install ESP32 toochain following steps as desribed - # in http://esp-idf.readthedocs.io/en/latest/linux-setup.html - # - # Get required packages - already done above, see addons: apt: packages: - # - sudo apt-get install git wget make libncurses-dev flex bison gperf python python-serial - # Prepare directory for the toolchain - - mkdir -p ~/esp - - cd ~/esp - # Download binary toolchain for the ESP32 - - wget https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz - - tar -xzf xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz - # Make xtensa-esp32-elf available for all terminal sessions - - export PATH=$PATH:$HOME/esp/xtensa-esp32-elf/bin - # Get ESP-IDF from github - - git clone --recursive --branch v3.3 --single-branch --shallow-submodules https://github.com/espressif/esp-idf.git - # Set the path to ESP-IDF directory - - export IDF_PATH=~/esp/esp-idf - # Install python dependencies - - pip install --requirement $IDF_PATH/requirements.txt + - stage: # IDF v4.1-beta1 + install: + - pushd ~ + - git clone --recursive --branch v4.1-beta1 --single-branch --shallow-submodules https://github.com/espressif/esp-idf.git esp-idf + - esp-idf/install.sh + - popd + script: + - source ~/esp-idf/export.sh && idf.py build -script: - # Build project within the original repository - - cd $PROJECT_PATH - - $IDF_PATH/tools/idf.py build