Commit 4fbb7cf2 authored by Adam Simpkins's avatar Adam Simpkins Committed by Facebook GitHub Bot

getdeps: avoid blowing away too much data when invalidating the CMake cache

Summary:
Previously getdeps would remove the entire top-level `CMakeFiles` directory
from the build output when it wanted to invalidate the CMake cache.  This
directory is used to keep all of the compiled object files for any libraries
or executables defined in the top-level CMakeLists.txt file.  Blowing away
this directory forces all of these sources to be re-compiled, even if this was
not necessary.  This is particularly problematic for folly, which compiles all
of its source files via rules in the top-level CMakeLists.txt target file.

I did have the code still blow away the CMake error and output logs in this
directory: in the past I have seen situations where CMake would not update
these files on new CMake runs if they already existed.

Reviewed By: wez

Differential Revision: D21360668

fbshipit-source-id: 6fcd1a8e371d756114fbab60d8636be8cd5f8978
parent 97a2fc14
...@@ -363,7 +363,11 @@ if __name__ == "__main__": ...@@ -363,7 +363,11 @@ if __name__ == "__main__":
self.defines = defines or {} self.defines = defines or {}
def _invalidate_cache(self): def _invalidate_cache(self):
for name in ["CMakeCache.txt", "CMakeFiles"]: for name in [
"CMakeCache.txt",
"CMakeFiles/CMakeError.log",
"CMakeFiles/CMakeOutput.log",
]:
name = os.path.join(self.build_dir, name) name = os.path.join(self.build_dir, name)
if os.path.isdir(name): if os.path.isdir(name):
shutil.rmtree(name) shutil.rmtree(name)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment