Skip to content

Commit

Permalink
zig: Add CFLAGS_EXTRA option
Browse files Browse the repository at this point in the history
This passes through extra options to the compiler. No validation is
performed, the value is passed through as-is.
  • Loading branch information
plajjan committed Jan 10, 2024
1 parent 98e4d0a commit 383b2ac
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ pub fn build(b: *std.Build) void {
// TODO: support build_cord
const build_tests = b.option(bool, "build_tests",
"Build tests") orelse false;
const cflags_extra = b.option([]const u8, "CFLAGS_EXTRA",
"Extra cflags") orelse "";
// TODO: support enable_docs
const enable_threads = b.option(bool, "enable_threads",
"Support threads") orelse default_enable_threads;
Expand Down Expand Up @@ -153,6 +155,8 @@ pub fn build(b: *std.Build) void {
//"-Wno-long-long",
}) catch unreachable;

flags.append(cflags_extra) catch unreachable;

source_files.appendSlice(&.{
"allchblk.c",
"alloc.c",
Expand Down

0 comments on commit 383b2ac

Please sign in to comment.