Add build switch to enable auto ccache

Make usage of ccache by build system opt-in.
v0.27.3
Andreas Sturmlechner 8 years ago
parent 5e8a76667a
commit 7f515e6da7
No known key found for this signature in database
GPG Key ID: E7255695D8BA079E

@ -46,6 +46,7 @@ option( EXIV2_BUILD_SAMPLES "Build sample applications"
option( EXIV2_BUILD_PO "Build translations files" OFF )
option( EXIV2_BUILD_EXIV2_COMMAND "Build exiv2 command-line executable" ON )
option( EXIV2_BUILD_UNIT_TESTS "Build unit tests" OFF )
option( BUILD_WITH_CCACHE "Use ccache to speed up compile time" OFF )
if ( EXIV2_ENABLE_WEBREADY )
set ( EXIV2_ENABLE_CURL ON )

@ -58,11 +58,13 @@ if( EXIV2_BUILD_PO )
endif()
endif()
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
message(STATUS "Program ccache found")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
if( BUILD_WITH_CCACHE )
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
message(STATUS "Program ccache found")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif()
endif()
if (EXIV2_BUILD_UNIT_TESTS)

@ -41,6 +41,7 @@ OptionOutput( "Building exiv2 command: " EXIV2_BUILD_EXIV2_COMMAND
OptionOutput( "Building samples: " EXIV2_BUILD_SAMPLES )
OptionOutput( "Building PO files: " EXIV2_BUILD_PO )
OptionOutput( "Building unit tests: " EXIV2_BUILD_UNIT_TESTS )
OptionOutput( "Using ccache: " BUILD_WITH_CCACHE )
message( STATUS "------------------------------------------------------------------" )

Loading…
Cancel
Save