- CentOS 7::
- sudo yum install git wget ncurses-devel flex bison gperf python pyserial cmake ninja-build
+ sudo yum install git wget ncurses-devel flex bison gperf python pyserial cmake ninja-build ccache
- Ubuntu and Debian::
- sudo apt-get install git wget libncurses-dev flex bison gperf python python-serial cmake ninja-build
+ sudo apt-get install git wget libncurses-dev flex bison gperf python python-serial cmake ninja-build ccache
- Arch::
- sudo pacman -S --needed gcc git make ncurses flex bison gperf python2-pyserial cmake ninja
+ sudo pacman -S --needed gcc git make ncurses flex bison gperf python2-pyserial cmake ninja ccache
.. note::
CMake version 3.5 or newer is required for use with ESP-IDF. Older Linux distributions may require updating, or enabling of a "backports" repository, or installing of a "cmake3" package not "cmake")
Otherwise, consult the CMake_ and Ninja_ home pages for Mac OS installation.
+- It is strongly recommended to also install ccache_ for faster builds. If you have HomeBrew, this can be done via ``brew install ccache``.
+
Toolchain Setup
===============
.. _cmake: https://cmake.org/
.. _ninja: https://ninja-build.org/
+.. _ccache: https://ccache.samba.org/
--- /dev/null
+# The following five 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(MAIN_SRCS main/blink.c)
+
+include($ENV{IDF_PATH}/tools/cmake/project.cmake)
+project(blink)
add_compile_options("-I${CMAKE_BINARY_DIR}") # for sdkconfig.h
+ # Enable ccache if it's on the path
+ find_program(CCACHE_FOUND ccache)
+ if(CCACHE_FOUND)
+ message(STATUS "ccache will be used")
+ set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
+ endif()
+
endfunction(idf_set_global_compiler_options)