From a27abab65f427507258b142862bcb7e28a90adc3 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Tue, 31 Oct 2023 08:10:41 -0400 Subject: [PATCH] Fix PCH to recompile on version change --- configure.ac | 4 ++++ src/config_package.h.in | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/configure.ac b/configure.ac index ade69cf7a..ab5c9f98a 100644 --- a/configure.ac +++ b/configure.ac @@ -24,6 +24,10 @@ AC_SUBST(PACKAGE_VERSION_NUMBER) AC_DEFINE_UNQUOTED([PACKAGE_VERSION_NUMBER_STRING],["$PACKAGE_VERSION_NUMBER"],[Package version as a number]) VERILATOR_VERSION_INTEGER=`AS_ECHO("$PACKAGE_VERSION") | [sed 's/\([0-9]\)\.\([0-9][0-9][0-9]\) .*/\1\2000/g']` AC_SUBST(VERILATOR_VERSION_INTEGER) +AC_DEFINE_UNQUOTED([PACKAGE_VERSION_STRING_CHAR], + [static const char* const PACKAGE_STRING_UNUSED = "$PACKAGE_STRING";], + [Package version as a number]) +AC_SUBST(PACKAGE_VERSION_STRING_CHAR) # Ignore automake flags passed by Ubuntu builds AC_ARG_ENABLE([dependency-tracking], diff --git a/src/config_package.h.in b/src/config_package.h.in index 25ccf8816..4588746aa 100644 --- a/src/config_package.h.in +++ b/src/config_package.h.in @@ -19,6 +19,14 @@ #define PACKAGE_VERSION_NUMBER_STRING "0.000" // Otherwise Autoheader generates it (with all the same macros and more) +// Force ccache recompilation on PACKAGE_STRING change +#ifndef VL_CPPCHECK +#ifndef PACKAGE_VERSION_STRING_CHAR +#define PACKAGE_VERSION_STRING_CHAR +PACKAGE_VERSION_STRING_CHAR +#endif +#endif + //********************************************************************** //**** Configure-discovered library options