1 From 9686aa8857bcd992ee4f23d20e80dfc31679f67a Mon Sep 17 00:00:00 2001
2 From: Andreas Sturmlechner <andreas.sturmlechner@gmail.com>
3 Date: Sun, 15 Oct 2017 09:28:09 +0200
4 Subject: [PATCH] Add build switch to disable auto ccache
6 Current usage of ccache leads to sandbox issues.
7 Be able to switch it off for package managers that already can
8 make use of ccache for build.
11 config/findDependencies.cmake | 12 +++++++-----
12 config/printSummary.cmake | 1 +
13 3 files changed, 9 insertions(+), 5 deletions(-)
15 diff --git a/CMakeLists.txt b/CMakeLists.txt
16 index 80fa907c..a60d4b2e 100644
19 @@ -41,6 +41,7 @@ option( EXIV2_ENABLE_SSH "USE Libssh for SshIo"
20 option( EXIV2_BUILD_SAMPLES "Build sample applications" ON )
21 option( EXIV2_BUILD_PO "Build translations files" OFF )
22 option( EXIV2_BUILD_EXIV2_COMMAND "Build exiv2 command-line executable" ON )
23 +option( BUILD_WITH_CCACHE "Use ccache to speed up compile time" ON )
25 if ( EXIV2_ENABLE_WEBREADY )
26 set ( EXIV2_ENABLE_CURL ON )
27 diff --git a/config/findDependencies.cmake b/config/findDependencies.cmake
28 index 16967763..d6af9488 100644
29 --- a/config/findDependencies.cmake
30 +++ b/config/findDependencies.cmake
31 @@ -58,9 +58,11 @@ if( EXIV2_ENABLE_BUILD_PO )
35 -find_program(CCACHE_FOUND ccache)
37 - message(STATUS "Program ccache found")
38 - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
39 - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
40 +if( BUILD_WITH_CCACHE )
41 + find_program(CCACHE_FOUND ccache)
43 + message(STATUS "Program ccache found")
44 + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
45 + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
48 diff --git a/config/printSummary.cmake b/config/printSummary.cmake
49 index 21e444a4..62ba4e98 100644
50 --- a/config/printSummary.cmake
51 +++ b/config/printSummary.cmake
52 @@ -40,6 +40,7 @@ endif()
53 OptionOutput( "Building exiv2 command: " EXIV2_BUILD_EXIV2_COMMAND )
54 OptionOutput( "Building samples: " EXIV2_BUILD_SAMPLES )
55 OptionOutput( "Building PO files: " EXIV2_BUILD_PO )
56 +OptionOutput( "Using ccache: " BUILD_WITH_CCACHE )
59 message( STATUS "------------------------------------------------------------------" )