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>
This commit is contained in:
parent
fc3a484a8c
commit
afc01f9570
@ -541,6 +541,13 @@ def cmake_args(self):
|
|||||||
|
|
||||||
def cmake(self, pkg, spec, prefix):
|
def cmake(self, pkg, spec, prefix):
|
||||||
"""Runs ``cmake`` in the build directory"""
|
"""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.std_cmake_args
|
||||||
options += self.cmake_args()
|
options += self.cmake_args()
|
||||||
options.append(os.path.abspath(self.root_cmakelists_dir))
|
options.append(os.path.abspath(self.root_cmakelists_dir))
|
||||||
|
Loading…
Reference in New Issue
Block a user