From 759518182c706a92b6bd79dc691ff7d1b6abbeb2 Mon Sep 17 00:00:00 2001 From: psakievich Date: Fri, 31 Jan 2025 07:48:41 -0700 Subject: [PATCH] Bug Fix: Better incremental check for CMake (#48775) * Bug Fix: Better incremental check for CMake * Fix syntax error * Ensure match of config artifact with generator --- lib/spack/spack/build_systems/cmake.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/spack/spack/build_systems/cmake.py b/lib/spack/spack/build_systems/cmake.py index c166e3ea63b..0c86c6bb643 100644 --- a/lib/spack/spack/build_systems/cmake.py +++ b/lib/spack/spack/build_systems/cmake.py @@ -459,8 +459,16 @@ def cmake( """Runs ``cmake`` in the build directory""" # skip cmake phase if it is an incremental develop build + # These are the files that will re-run CMake that are generated from a successful + # configure step + primary_generator = _extract_primary_generator(self.generator) + if primary_generator == "Unix Makefiles": + configure_artifact = "Makefile" + elif primary_generator == "Ninja": + configure_artifact = "ninja.build" + if spec.is_develop and os.path.isfile( - os.path.join(self.build_directory, "CMakeCache.txt") + os.path.join(self.build_directory, configure_artifact) ): return