[PATCH] D105447: [analyzer] Allow cmake options to be passed to satest container

Manas Gupta via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 5 16:11:06 PDT 2021


manas updated this revision to Diff 356575.
manas edited the summary of this revision.
manas added a comment.

Edit summary


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105447

Files:
  clang/utils/analyzer/entrypoint.py


Index: clang/utils/analyzer/entrypoint.py
===================================================================
--- clang/utils/analyzer/entrypoint.py
+++ clang/utils/analyzer/entrypoint.py
@@ -9,10 +9,11 @@
 
 def main():
     settings, rest = parse_arguments()
+    cmake_opts = list(filter(lambda cmd: cmd[:2]=='-D', rest))
     if settings.wait:
         wait()
     if settings.build_llvm or settings.build_llvm_only:
-        build_llvm()
+        build_llvm(cmake_opts)
     if settings.build_llvm_only:
         return
     sys.exit(test(rest))
@@ -33,11 +34,11 @@
     return parser.parse_known_args()
 
 
-def build_llvm():
+def build_llvm(cmake_options):
     os.chdir('/build')
     try:
         if is_cmake_needed():
-            cmake()
+            cmake(cmake_options)
         ninja()
     except CalledProcessError:
         print("Build failed!")
@@ -55,8 +56,9 @@
     "-DCLANG_ENABLE_STATIC_ANALYZER=ON"
 
 
-def cmake():
-    check_call(CMAKE_COMMAND + ' /llvm-project/llvm', shell=True)
+def cmake(cmake_options):
+    check_call(CMAKE_COMMAND + ' '.join(cmake_options) + ' /llvm-project/llvm',
+            shell=True)
 
 
 def ninja():


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105447.356575.patch
Type: text/x-patch
Size: 1160 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210705/53ae2f1c/attachment.bin>


More information about the cfe-commits mailing list