diff options
author | psakievich <psakiev@sandia.gov> | 2024-10-10 00:45:10 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-10 00:45:10 -0600 |
commit | afc01f95704a9fd06398222fc5f8d5416af1afb4 (patch) | |
tree | a3b883cec83b5af284ed811632299224296e8fcc /lib | |
parent | fc3a484a8ca0d0f47252b2551fd87b0154c45074 (diff) | |
download | spack-afc01f95704a9fd06398222fc5f8d5416af1afb4.tar.gz spack-afc01f95704a9fd06398222fc5f8d5416af1afb4.tar.bz2 spack-afc01f95704a9fd06398222fc5f8d5416af1afb4.tar.xz spack-afc01f95704a9fd06398222fc5f8d5416af1afb4.zip |
CMake: Improve incremental build speed. (#46878)
* CMake: Improve incremental build speed.
CMake automatically embeds an updated configure step into make/ninja that will be called during the build phase. By default if a `CMakeCache.txt` file exists in the build directory CMake will use it and this + `spec.is_develop` is sufficient evidence of an incremental build.
This PR removes duplicate work/expense from CMake packages when using `spack develop`.
* Update cmake.py
* [@spackbot] updating style on behalf of psakievich
* Update cmake.py
meant self not spec...
---------
Co-authored-by: psakievich <psakievich@users.noreply.github.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/build_systems/cmake.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/spack/spack/build_systems/cmake.py b/lib/spack/spack/build_systems/cmake.py index 93d3485ae0..7752c473f6 100644 --- a/lib/spack/spack/build_systems/cmake.py +++ b/lib/spack/spack/build_systems/cmake.py @@ -541,6 +541,13 @@ class CMakeBuilder(BaseBuilder): def cmake(self, pkg, spec, prefix): """Runs ``cmake`` in the build directory""" + + # skip cmake phase if it is an incremental develop build + if spec.is_develop and os.path.isfile( + os.path.join(self.build_directory, "CMakeCache.txt") + ): + return + options = self.std_cmake_args options += self.cmake_args() options.append(os.path.abspath(self.root_cmakelists_dir)) |