[BUILD] Still build even if lit is not installed on user's system (#1095)

Otherwise it fails with

```
File "setup.py", line 147, in build_extension
    "-DLLVM_EXTERNAL_LIT=" + lit_dir,`
TypeError: can only concatenate str (not "NoneType") to str
```

Signed-off-by: Edward Z. Yang <ezyang@meta.com>
This commit is contained in:
Edward Z. Yang
2023-01-25 15:55:59 -05:00
committed by GitHub
parent 34ac01e597
commit cf0ae2ed76

View File

@@ -144,8 +144,10 @@ class CMakeBuild(build_ext):
"-DPython3_EXECUTABLE:FILEPATH=" + sys.executable,
"-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON",
"-DPYTHON_INCLUDE_DIRS=" + python_include_dir,
"-DLLVM_EXTERNAL_LIT=" + lit_dir,
] + thirdparty_cmake_args
]
if lit_dir is not None:
cmake_args.append("-DLLVM_EXTERNAL_LIT=" + lit_dir)
cmake_args.extend(thirdparty_cmake_args)
# configuration
cfg = get_build_type()