diff --git a/clang/utils/analyzer/entrypoint.py b/clang/utils/analyzer/entrypoint.py --- a/clang/utils/analyzer/entrypoint.py +++ b/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!") @@ -50,13 +51,14 @@ CMAKE_COMMAND = "cmake -G Ninja -DCMAKE_BUILD_TYPE=Release " \ "-DCMAKE_INSTALL_PREFIX=/analyzer -DLLVM_TARGETS_TO_BUILD=X86 " \ - "-DLLVM_ENABLE_PROJECTS=\"clang;openmp\" -DLLVM_BUILD_RUNTIME=OFF " \ + "-DLLVM_ENABLE_PROJECTS=\"clang;openmp\" " \ "-DLLVM_ENABLE_TERMINFO=OFF -DCLANG_ENABLE_ARCMT=OFF " \ "-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():