We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 68d5872 commit 3aa71a1Copy full SHA for 3aa71a1
1 file changed
build.zig
@@ -7,6 +7,8 @@ pub fn build(b: *Build) void {
7
8
const mbedtls_dep = b.dependency("mbedtls", .{});
9
10
+ const threading = b.option(bool, "threading", "Enable thread safety") orelse false;
11
+
12
const mbedtls = b.addLibrary(.{
13
.name = "mbedtls",
14
.linkage = .static,
@@ -25,6 +27,10 @@ pub fn build(b: *Build) void {
25
27
// Otherwise `explicit_bzero` cannot be found
26
28
mbedtls.root_module.addCMacro("__BSD_VISIBLE", "1");
29
}
30
+ if (threading) {
31
+ mbedtls.root_module.addCMacro("MBEDTLS_THREADING_C", "");
32
+ mbedtls.root_module.addCMacro("MBEDTLS_THREADING_PTHREAD", "");
33
+ }
34
35
mbedtls.installHeadersDirectory(mbedtls_dep.path("include/mbedtls"), "mbedtls", .{});
36
mbedtls.installHeadersDirectory(mbedtls_dep.path("include/psa"), "psa", .{});
0 commit comments