Skip to content

Commit

Permalink
refactor: simplify LLVM name creation
Browse files Browse the repository at this point in the history
  • Loading branch information
tensorush committed Jul 23, 2024
1 parent a063cf6 commit 7334cf9
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,7 @@ pub fn build(b: *std.Build) !void {

const llvm_inc_dir = std.mem.trimRight(u8, b.run(&.{ "llvm-config", "--includedir" }), "\n");
const llvm_inc_path = std.Build.LazyPath{ .cwd_relative = llvm_inc_dir };

const llvm_libs = std.mem.trimRight(u8, b.run(&.{ "llvm-config", "--libs" }), "\n");
const llvm_name: []const u8 = blk: {
if (std.mem.indexOf(u8, llvm_libs, "-lLLVM-1")) |llvm_lib_name_idx| {
break :blk llvm_libs[llvm_lib_name_idx + 2 .. llvm_lib_name_idx + 9];
}
break :blk "LLVM";
};
const llvm_name = b.fmt("LLVM-{}", .{llvm_major});

const llvm_common_obj = b.addObject(.{
.name = "afl-llvm-common",
Expand Down

0 comments on commit 7334cf9

Please sign in to comment.