Last active
February 25, 2021 04:30
-
-
Save marler8997/7a5e8c34078660d7762e68ffd5d8bb5e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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