diff --git a/cmake/MusrfitCheckROOT7.cmake b/cmake/MusrfitCheckROOT7.cmake index 620ec5ae..52111a69 100644 --- a/cmake/MusrfitCheckROOT7.cmake +++ b/cmake/MusrfitCheckROOT7.cmake @@ -138,6 +138,15 @@ set(CMAKE_REQUIRED_QUIET TRUE) set(_musrview_try_compile_type_save "${CMAKE_TRY_COMPILE_TARGET_TYPE}") set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) +#--- check_cxx_source_compiles() caches its result under a plain variable +#--- name with no dependency tracking: if it once failed (e.g. against an +#--- older ROOT in this same build directory) it would keep reporting that +#--- stale failure on every later reconfigure, even after ROOT got fixed, +#--- since neither the test source nor ROOT_VERSION are part of the cache +#--- key. Unset both results first so the compile check always re-runs. ------ +unset(MUSRVIEW_HAS_ROOT7_API CACHE) +unset(MUSRVIEW_HAS_ROOT7_API_EXPERIMENTAL CACHE) + set(MUSRVIEW_NS "ROOT::") string(CONFIGURE "${MUSRVIEW_ROOT7_API_TEST_SRC}" _musrview_api_src @ONLY) check_cxx_source_compiles("${_musrview_api_src}" MUSRVIEW_HAS_ROOT7_API)