Skip to content

Commit

Permalink
Merge 881dd54 into 1817e30
Browse files Browse the repository at this point in the history
  • Loading branch information
dagar committed Jan 28, 2019
2 parents 1817e30 + 881dd54 commit 43b394c
Show file tree
Hide file tree
Showing 8 changed files with 205 additions and 32 deletions.
19 changes: 19 additions & 0 deletions CMakeLists.txt
Expand Up @@ -8,6 +8,25 @@ cmake_policy(SET CMP0025 NEW)

project(dronecode_sdk)

# ccache
option(CCACHE "Use ccache if available" ON)
find_program(CCACHE_PROGRAM ccache)
if (CCACHE AND CCACHE_PROGRAM AND NOT DEFINED ENV{CCACHE_DISABLE})

get_filename_component(ccache_real_path ${CCACHE_PROGRAM} REALPATH)
get_filename_component(cxx_real_path ${CMAKE_CXX_COMPILER} REALPATH)
get_filename_component(cxx_abs_path ${CMAKE_CXX_COMPILER} ABSOLUTE)

if ("${ccache_real_path}" STREQUAL "${cxx_real_path}")
message(STATUS "ccache enabled via symlink (${cxx_abs_path} -> ${cxx_real_path})")
else()
message(STATUS "ccache enabled (export CCACHE_DISABLE=1 to disable)")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
endif()

endif()


option(BUILD_TESTS "Build tests" ON)

include(cmake/compiler_flags.cmake)
Expand Down

0 comments on commit 43b394c

Please sign in to comment.