[PATCH] D81596: [analyzer] SATest: Do not re-run CMake in Docker if not needed

Valeriy Savchenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 25 02:31:30 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG061b5bf914c6: [analyzer] SATest: Do not re-run CMake in Docker if not needed (authored by vsavchenko).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81596/new/

https://reviews.llvm.org/D81596

Files:
  clang/utils/analyzer/entrypoint.py


Index: clang/utils/analyzer/entrypoint.py
===================================================================
--- clang/utils/analyzer/entrypoint.py
+++ clang/utils/analyzer/entrypoint.py
@@ -23,16 +23,21 @@
     return parser.parse_known_args()
 
 
-def build_llvm() -> None:
+def build_llvm():
     os.chdir('/build')
     try:
-        cmake()
+        if is_cmake_needed():
+            cmake()
         ninja()
     except CalledProcessError:
         print("Build failed!")
         sys.exit(1)
 
 
+def is_cmake_needed():
+    return "build.ninja" not in os.listdir()
+
+
 CMAKE_COMMAND = "cmake -G Ninja -DCMAKE_BUILD_TYPE=Release " \
     "-DCMAKE_INSTALL_PREFIX=/analyzer -DLLVM_TARGETS_TO_BUILD=X86 " \
     "-DLLVM_ENABLE_PROJECTS=clang -DLLVM_BUILD_RUNTIME=OFF " \


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81596.273273.patch
Type: text/x-patch
Size: 778 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200625/9f82d248/attachment-0001.bin>


More information about the cfe-commits mailing list