Skip to content

Commit be5e294

Browse files
authored
Merge pull request #285 from jinzhongjia/main
[fix]: build error on windows with `build.zig`
2 parents c86fc0c + 8e09735 commit be5e294

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

build.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ fn build_civetweb(b: *Build, optimize: OptimizeMode, target: CrossTarget, is_sta
6868

6969
civetweb.addIncludePath(.{ .path = "include" });
7070

71-
const extra_flags = if (target.os_tag == .windows) "-DMUST_IMPLEMENT_CLOCK_GETTIME" else "";
71+
const extra_flags = if (target.os_tag == .windows or (target.os_tag == null and builtin.os.tag == .windows)) "-DMUST_IMPLEMENT_CLOCK_GETTIME" else "";
7272

7373
const cflags = if (enable_tls) [_][]const u8{ "-DNDEBUG", "-DNO_CACHING", "-DNO_CGI", "-DUSE_WEBSOCKET", "-DWEBUI_TLS", "-DNO_SSL_DL", "-DOPENSSL_API_1_1", extra_flags } else [_][]const u8{ "-DNDEBUG", "-DNO_CACHING", "-DNO_CGI", "-DUSE_WEBSOCKET", "-DNO_SSL", extra_flags, "", "" };
7474

@@ -79,7 +79,7 @@ fn build_civetweb(b: *Build, optimize: OptimizeMode, target: CrossTarget, is_sta
7979

8080
civetweb.linkLibC();
8181

82-
if (target.os_tag == .windows) {
82+
if (target.os_tag == .windows or (target.os_tag == null and builtin.os.tag == .windows)) {
8383
civetweb.linkSystemLibrary("ws2_32");
8484
if (enable_tls) {
8585
civetweb.linkSystemLibrary("bcrypt");

0 commit comments

Comments
 (0)