Skip to content

Commit

Permalink
build: do not build gnu targets with -Dall
Browse files Browse the repository at this point in the history
  • Loading branch information
ripperi committed Nov 4, 2024
1 parent 689bbe9 commit c060e3d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@ const std = @import("std");

const VERSION = "3.2";

const targets: []const std.Target.Query = &.{
const main_targets = .{
.{ .cpu_arch = .aarch64, .os_tag = .macos, .abi = null },
.{ .cpu_arch = .x86_64, .os_tag = .macos, .abi = null },
.{ .cpu_arch = .aarch64, .os_tag = .linux, .abi = .gnu },
.{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .gnu },
.{ .cpu_arch = .aarch64, .os_tag = .linux, .abi = .musl },
.{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .musl },
};

const supported_targets: []const std.Target.Query = &(main_targets ++ .{
.{ .cpu_arch = .aarch64, .os_tag = .linux, .abi = .gnu },
.{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .gnu },
});

const targets: []const std.Target.Query = &main_targets;

const BuildCfg = struct {
version: []const u8,
pace: []const u8,
Expand All @@ -24,7 +29,7 @@ const BuildCfg = struct {
};

pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{ .whitelist = targets });
const target = b.standardTargetOptions(.{ .whitelist = supported_targets });
var optimize = b.standardOptimizeOption(.{});

//
Expand Down

0 comments on commit c060e3d

Please sign in to comment.