|
|
@@ -47,7 +47,7 @@ def query_llvm_version(llvm_info):
|
|
|
return response['sha']
|
|
|
|
|
|
|
|
|
-def build_llvm(llvm_dir, platform, backends, projects, use_clang=False):
|
|
|
+def build_llvm(llvm_dir, platform, backends, projects, use_clang=False, extra_flags=''):
|
|
|
LLVM_COMPILE_OPTIONS = [
|
|
|
'-DCMAKE_BUILD_TYPE:STRING="Release"',
|
|
|
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON",
|
|
|
@@ -143,7 +143,7 @@ def build_llvm(llvm_dir, platform, backends, projects, use_clang=False):
|
|
|
+ LLVM_INCLUDE_TOOLS_OPTION
|
|
|
)
|
|
|
|
|
|
- CONFIG_CMD = f"cmake {compile_options} ../llvm"
|
|
|
+ CONFIG_CMD = f"cmake {compile_options} {extra_flags} ../llvm"
|
|
|
if "windows" == platform:
|
|
|
if "mingw" in sysconfig.get_platform().lower():
|
|
|
CONFIG_CMD += " -G'Unix Makefiles'"
|
|
|
@@ -227,6 +227,12 @@ def main():
|
|
|
action="store_true",
|
|
|
help="use clang instead of gcc",
|
|
|
)
|
|
|
+ parser.add_argument(
|
|
|
+ "--extra-cmake-flags",
|
|
|
+ type=str,
|
|
|
+ default="",
|
|
|
+ help="custom extra cmake flags",
|
|
|
+ )
|
|
|
options = parser.parse_args()
|
|
|
|
|
|
# if the "platform" is not identified in the command line option,
|
|
|
@@ -275,7 +281,8 @@ def main():
|
|
|
llvm_dir = clone_llvm(deps_dir, llvm_info["repo"], llvm_info["branch"])
|
|
|
if (
|
|
|
build_llvm(
|
|
|
- llvm_dir, platform, options.arch, options.project, options.use_clang
|
|
|
+ llvm_dir, platform, options.arch, options.project, options.use_clang,
|
|
|
+ options.extra_cmake_flags
|
|
|
)
|
|
|
is not None
|
|
|
):
|