@@ -20,11 +20,12 @@ pub fn build(b: *Build) void {
20
20
const strip = b .option (bool , "strip" , "Strip debug information" ) orelse false ;
21
21
const lto = b .option (bool , "lto" , "Enable link time optimization" ) orelse false ;
22
22
23
- const is_macos = builtin .os .tag == .macos or target .result .os .tag == .macos ;
24
- const is_windows = builtin .os .tag == .windows or target .result .os .tag == .windows ;
25
-
23
+ const is_macos = builtin .os .tag == .macos ;
24
+ const need_resolve_h = is_macos or target .result .os .tag == .macos ;
25
+ const is_windows = builtin .os .tag == .windows ;
26
+
26
27
// writing WritingLibFiles in zld isn't implemented on windows
27
- // and zld is the only linker suppored on macos
28
+ // and zld is the only linker supported on macos
28
29
const use_lld = if (is_macos ) false else if (is_windows ) true else switch (optimize ) {
29
30
.Debug = > false ,
30
31
else = > true ,
@@ -66,7 +67,7 @@ pub fn build(b: *Build) void {
66
67
});
67
68
liblmdb .addIncludePath (lmdb_upstream .path (lmdb_root ));
68
69
liblmdb .root_module .addCMacro ("_XOPEN_SOURCE" , "600" );
69
- if (is_macos ) {
70
+ if (need_resolve_h ) {
70
71
liblmdb .root_module .addCMacro ("_DARWIN_C_SOURCE" , "" );
71
72
}
72
73
@@ -112,7 +113,7 @@ pub fn build(b: *Build) void {
112
113
});
113
114
tool .addIncludePath (lmdb_upstream .path (lmdb_root ));
114
115
tool .root_module .addCMacro ("_XOPEN_SOURCE" , "600" );
115
- if (is_macos ) {
116
+ if (need_resolve_h ) {
116
117
tool .root_module .addCMacro ("_DARWIN_C_SOURCE" , "" );
117
118
}
118
119
tool .linkLibrary (liblmdb );
0 commit comments