From ed1ecfb39cf0f3344810fabb7a1b855d373aa0a8 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Wed, 20 Sep 2017 16:19:04 -0700 Subject: CMake: Print a warning if CCACHE_CPP2 is unset. If we're compiling with clang and ccache, print a warning if CCACHE_CPP2 is unset. Doing so avoids generating a bunch of unwanted output when warnings are enabled. Change-Id: I6a796e8b910074ffa028ea45bc639b9461e1629e Reviewed-on: https://code.wireshark.org/review/23646 Petri-Dish: Gerald Combs Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index d06049c5a2..5596cafa3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1291,6 +1291,10 @@ if(ENABLE_CCACHE AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Cl if(CCACHE_EXECUTABLE) set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_EXECUTABLE}") set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCACHE_EXECUTABLE}") + # http://peter.eisentraut.org/blog/2014/12/01/ccache-and-clang-part-3/ + if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT DEFINED(ENV{CCACHE_CPP2})) + message(WARNING "You're compiling using clang and ccache but CCACHE_CPP2 unset. This might produce unwanted warnings.") + endif() endif() endif() -- cgit v1.2.3