aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2024-06-30 11:02:05 +0100
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2024-08-16 19:27:37 +0100
commitdbb7ed14e8562439238eec70b202c50f172e3def (patch)
tree7f09b3ad1ae3b46a63ae86591f43963db27abea1 /CMakeLists.txt
parentcedfdf6c72535d0797a271c6bb9d84c4b406a8ea (diff)
downloadbitcoin-dbb7ed14e8562439238eec70b202c50f172e3def.tar.xz
cmake: Add `ccache` support
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0edb4931c5..f76e61e5b8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -61,6 +61,12 @@ set(CMAKE_CXX_EXTENSIONS OFF)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/module)
+#=============================
+# Configurable options
+#=============================
+# When adding a new option, end the <help_text> with a full stop for consistency.
+option(WITH_CCACHE "Attempt to use ccache for compiling." ON)
+
set(configure_warnings)
include(CheckPIESupported)
@@ -184,6 +190,8 @@ target_link_libraries(core_interface INTERFACE
include(cmake/introspection.cmake)
+include(cmake/ccache.cmake)
+
# Don't allow extended (non-ASCII) symbols in identifiers. This is easier for code review.
try_append_cxx_flags("-fno-extended-identifiers" TARGET core_interface SKIP_LINK)
@@ -209,6 +217,7 @@ message("=================")
message("C++ compiler .......................... ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}, ${CMAKE_CXX_COMPILER}")
include(FlagsSummary)
flags_summary()
+message("Use ccache for compiling .............. ${WITH_CCACHE}")
message("\n")
if(configure_warnings)
message(" ******\n")