From b7f556e4b444798e5cab2f6bbfa7f6164862700e Mon Sep 17 00:00:00 2001 From: psakievich Date: Tue, 4 Feb 2025 07:20:15 -0700 Subject: [PATCH] Remove variable from cmake.py (#48824) * Remove variable from cmake.py #48775 left a dangling variable that was not caught in CI but by the eyes of @haampie. Restructure variable to local method. * [@spackbot] updating style on behalf of psakievich * Update cmake.py * Update lib/spack/spack/build_systems/cmake.py * Update lib/spack/spack/build_systems/cmake.py --------- Co-authored-by: psakievich --- lib/spack/spack/build_systems/cmake.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/lib/spack/spack/build_systems/cmake.py b/lib/spack/spack/build_systems/cmake.py index 0c86c6bb643..c938380088a 100644 --- a/lib/spack/spack/build_systems/cmake.py +++ b/lib/spack/spack/build_systems/cmake.py @@ -458,19 +458,18 @@ def cmake( ) -> None: """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: + # skip cmake phase if it is an incremental develop build - if spec.is_develop and os.path.isfile( - os.path.join(self.build_directory, configure_artifact) - ): - return + # Determine the files that will re-run CMake that are generated from a successful + # configure step based on state + primary_generator = _extract_primary_generator(self.generator) + configure_artifact = "Makefile" + if primary_generator == "Ninja": + configure_artifact = "ninja.build" + + if os.path.isfile(os.path.join(self.build_directory, configure_artifact)): + return options = self.std_cmake_args options += self.cmake_args()