mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-09 05:06:17 +00:00
enable custom llvm build flags (#2000)
This commit is contained in:
parent
e8d718096d
commit
e6a0184797
|
@ -47,7 +47,7 @@ def query_llvm_version(llvm_info):
|
||||||
return response['sha']
|
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 = [
|
LLVM_COMPILE_OPTIONS = [
|
||||||
'-DCMAKE_BUILD_TYPE:STRING="Release"',
|
'-DCMAKE_BUILD_TYPE:STRING="Release"',
|
||||||
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON",
|
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON",
|
||||||
|
@ -143,7 +143,7 @@ def build_llvm(llvm_dir, platform, backends, projects, use_clang=False):
|
||||||
+ LLVM_INCLUDE_TOOLS_OPTION
|
+ LLVM_INCLUDE_TOOLS_OPTION
|
||||||
)
|
)
|
||||||
|
|
||||||
CONFIG_CMD = f"cmake {compile_options} ../llvm"
|
CONFIG_CMD = f"cmake {compile_options} {extra_flags} ../llvm"
|
||||||
if "windows" == platform:
|
if "windows" == platform:
|
||||||
if "mingw" in sysconfig.get_platform().lower():
|
if "mingw" in sysconfig.get_platform().lower():
|
||||||
CONFIG_CMD += " -G'Unix Makefiles'"
|
CONFIG_CMD += " -G'Unix Makefiles'"
|
||||||
|
@ -227,6 +227,12 @@ def main():
|
||||||
action="store_true",
|
action="store_true",
|
||||||
help="use clang instead of gcc",
|
help="use clang instead of gcc",
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--extra-cmake-flags",
|
||||||
|
type=str,
|
||||||
|
default="",
|
||||||
|
help="custom extra cmake flags",
|
||||||
|
)
|
||||||
options = parser.parse_args()
|
options = parser.parse_args()
|
||||||
|
|
||||||
# if the "platform" is not identified in the command line option,
|
# 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"])
|
llvm_dir = clone_llvm(deps_dir, llvm_info["repo"], llvm_info["branch"])
|
||||||
if (
|
if (
|
||||||
build_llvm(
|
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
|
is not None
|
||||||
):
|
):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user