aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2017-09-20 16:19:04 -0700
committerAnders Broman <a.broman58@gmail.com>2017-09-22 04:50:31 +0000
commited1ecfb39cf0f3344810fabb7a1b855d373aa0a8 (patch)
tree3cf13802e8d299538a6fd6354d742ea664c3e985
parent5f667694d3bbd57f13c26d3588d5671dfd30d09a (diff)
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 <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d06049c..5596caf 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()