aboutsummaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-08-31 22:50:10 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-08-31 23:36:25 -0700
commit77516af118f219f9d73494c8a1d5df3e23672680 (patch)
treeb9e6a0ef5556fca556a22ec2dc29610c4ad68041 /build.zig
parent7efca2e6f51458de8e70a6f5cbbc292026321681 (diff)
downloadzig-77516af118f219f9d73494c8a1d5df3e23672680.tar.gz
zig-77516af118f219f9d73494c8a1d5df3e23672680.zip
stage2: update LLVM backend to for LLVM 13
There was some new code in master branch enumerating all the targets and a new target was added so we needed to add the glue code. This commit also introduces some build options to support experimental LLVM targets.
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig28
1 files changed, 28 insertions, 0 deletions
diff --git a/build.zig b/build.zig
index e2665557b8..8bbf06e83a 100644
--- a/build.zig
+++ b/build.zig
@@ -64,6 +64,26 @@ pub fn build(b: *Builder) !void {
const omit_stage2 = b.option(bool, "omit-stage2", "Do not include stage2 behind a feature flag inside stage1") orelse false;
const static_llvm = b.option(bool, "static-llvm", "Disable integration with system-installed LLVM, Clang, LLD, and libc++") orelse false;
const enable_llvm = b.option(bool, "enable-llvm", "Build self-hosted compiler with LLVM backend enabled") orelse (is_stage1 or static_llvm);
+ const llvm_has_m68k = b.option(
+ bool,
+ "llvm-has-m68k",
+ "Whether LLVM has the experimental target m68k enabled",
+ ) orelse false;
+ const llvm_has_csky = b.option(
+ bool,
+ "llvm-has-csky",
+ "Whether LLVM has the experimental target csky enabled",
+ ) orelse false;
+ const llvm_has_ve = b.option(
+ bool,
+ "llvm-has-ve",
+ "Whether LLVM has the experimental target ve enabled",
+ ) orelse false;
+ const llvm_has_arc = b.option(
+ bool,
+ "llvm-has-arc",
+ "Whether LLVM has the experimental target arc enabled",
+ ) orelse false;
const enable_macos_sdk = b.option(bool, "enable-macos-sdk", "Run tests requiring presence of macOS SDK and frameworks") orelse false;
const config_h_path_option = b.option([]const u8, "config_h", "Path to the generated config.h");
@@ -115,6 +135,10 @@ pub fn build(b: *Builder) !void {
exe_options.addOption(u32, "mem_leak_frames", mem_leak_frames);
exe_options.addOption(bool, "skip_non_native", skip_non_native);
exe_options.addOption(bool, "have_llvm", enable_llvm);
+ exe_options.addOption(bool, "llvm_has_m68k", llvm_has_m68k);
+ exe_options.addOption(bool, "llvm_has_csky", llvm_has_csky);
+ exe_options.addOption(bool, "llvm_has_ve", llvm_has_ve);
+ exe_options.addOption(bool, "llvm_has_arc", llvm_has_arc);
if (enable_llvm) {
const cmake_cfg = if (static_llvm) null else findAndParseConfigH(b, config_h_path_option);
@@ -261,6 +285,10 @@ pub fn build(b: *Builder) !void {
test_stage2_options.addOption(bool, "is_stage1", is_stage1);
test_stage2_options.addOption(bool, "omit_stage2", omit_stage2);
test_stage2_options.addOption(bool, "have_llvm", enable_llvm);
+ test_stage2_options.addOption(bool, "llvm_has_m68k", llvm_has_m68k);
+ test_stage2_options.addOption(bool, "llvm_has_csky", llvm_has_csky);
+ test_stage2_options.addOption(bool, "llvm_has_ve", llvm_has_ve);
+ test_stage2_options.addOption(bool, "llvm_has_arc", llvm_has_arc);
test_stage2_options.addOption(bool, "enable_qemu", is_qemu_enabled);
test_stage2_options.addOption(bool, "enable_wine", is_wine_enabled);
test_stage2_options.addOption(bool, "enable_wasmtime", is_wasmtime_enabled);