Skip to content

Instantly share code, notes, and snippets.

@marler8997
Last active February 25, 2021 04:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marler8997/7a5e8c34078660d7762e68ffd5d8bb5e to your computer and use it in GitHub Desktop.
Save marler8997/7a5e8c34078660d7762e68ffd5d8bb5e to your computer and use it in GitHub Desktop.
pub const ComptimeBuildOptions = struct {
openssl: std.build.ComptimeOption(bool, "openssl", "enable openssl backend");
wolfssl: std.build.ComptimeOption(bool, "wolfssl", "enable wolfssl backend"),
bearssl: std.build.ComptimeOption(bool, "bearssl", "enable bearssl backend"),
schannel: std.build.ComptimeOption(bool, "schannel", "enable schannel backend"),
};
pub fn build(b: *Builder) !void {
// NOTE: this if is comptime!
if (b.comptime_options.openssl) {
const opensslbuild = @import("opensslbuild");
opensslbuild.link(exe);
}
if (b.comptime_options.wolfssl) {
// ...
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment