mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
cmake: Automatically include ccache if it's on the path
This commit is contained in:
parent
9f8cdd3572
commit
15d5e88618
@ -12,15 +12,15 @@ To compile with ESP-IDF you need to get the following packages:
|
|||||||
|
|
||||||
- CentOS 7::
|
- 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::
|
- 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::
|
- 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::
|
.. 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")
|
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")
|
||||||
|
@ -24,6 +24,8 @@ Install Prerequisites
|
|||||||
|
|
||||||
Otherwise, consult the CMake_ and Ninja_ home pages for Mac OS installation.
|
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
|
Toolchain Setup
|
||||||
===============
|
===============
|
||||||
|
|
||||||
@ -59,3 +61,4 @@ To carry on with development environment setup, proceed to section :ref:`get-sta
|
|||||||
|
|
||||||
.. _cmake: https://cmake.org/
|
.. _cmake: https://cmake.org/
|
||||||
.. _ninja: https://ninja-build.org/
|
.. _ninja: https://ninja-build.org/
|
||||||
|
.. _ccache: https://ccache.samba.org/
|
||||||
|
8
examples/get-started/blink/CMakeLists.txt
Normal file
8
examples/get-started/blink/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# 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)
|
@ -86,6 +86,13 @@ function(idf_set_global_compiler_options)
|
|||||||
|
|
||||||
add_compile_options("-I${CMAKE_BINARY_DIR}") # for sdkconfig.h
|
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)
|
endfunction(idf_set_global_compiler_options)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user