cmake: Find out earlier whether ccache is to be used or not

Moving the ccache build script earlier in allows us to export ccache
to external projects. Using ccache with external projects, such as
OpenThread, can significantly speed up the build time.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit is contained in:
Sebastian Bøe 2018-02-26 13:49:54 +01:00 committed by Anas Nashif
commit 87031e3cf9
2 changed files with 2 additions and 2 deletions

View file

@ -1090,8 +1090,6 @@ add_subdirectory(cmake/flash)
add_subdirectory(cmake/usage)
add_subdirectory(cmake/reports)
include(cmake/ccache.cmake)
if(CONFIG_ASSERT)
message(WARNING "
------------------------------------------------------------

View file

@ -88,6 +88,8 @@ include(${ZEPHYR_BASE}/cmake/extensions.cmake)
find_package(PythonInterp 3.4)
include(${ZEPHYR_BASE}/cmake/ccache.cmake)
if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
message(FATAL_ERROR "Source directory equals build directory.\
In-source builds are not supported.\