diff --git a/script/x86_64_linux_gnu_clang.py b/script/x86_64_linux_gnu_clang.py index 6e7d5c1..5c021d3 100755 --- a/script/x86_64_linux_gnu_clang.py +++ b/script/x86_64_linux_gnu_clang.py @@ -27,8 +27,9 @@ def build(stage: int = env.stage) -> None: env.remove_build_dir("runtimes") env.stage += 1 + basic_command = ("-stdlib=libc++", "-unwindlib=libunwind", "-rtlib=compiler-rt") if env.stage == 2: - env.config("llvm", env.host, "-stdlib=libc++ -unwindlib=libunwind -rtlib=compiler-rt", **{**env.dylib_option_list, **env.llvm_option_list_2}) + env.config("llvm", env.host, *basic_command, **{**env.dylib_option_list, **env.llvm_option_list_2}) env.make("llvm") env.install("llvm") env.copy_llvm_libs() @@ -36,17 +37,17 @@ def build(stage: int = env.stage) -> None: if env.stage == 3: for target in llvm.system_list.keys(): - command = "-stdlib=libc++ -unwindlib=libunwind -rtlib=compiler-rt " + command = basic_command match target: case "x86_64-w64-mingw32": option = env.llvm_option_list_w64_3 - command += "-lgcc -lunwind -lsupc++" + command = (*basic_command, "-lgcc", "-lunwind,", "-lsupc++") case "i686-w64-mingw32": option = env.llvm_option_list_w32_3 - command += "-lgcc -lunwind -lsupc++" + command = (*basic_command, "-lgcc", "-lunwind,", "-lsupc++") case _: option = env.llvm_option_list_3 - env.config("runtimes", target, command, **option) + env.config("runtimes", target, *command, **option) env.make("runtimes") env.install("runtimes") env.build_sysroot(target) @@ -58,6 +59,5 @@ def build(stage: int = env.stage) -> None: env.package() - if __name__ == "__main__": build()