mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-08-03 03:06:55 -04:00
Make it compile on windows and remove -gdwarf-4 (a workaround to an old zig compiler issue).
This commit is contained in:
parent
3aed075a88
commit
0c32d76a4a
@ -18,7 +18,7 @@ pub fn build(b: *std.build.Builder) void {
|
||||
if(target.getOsTag() == .windows) {
|
||||
exe.addCSourceFiles(&[_][]const u8 {
|
||||
"lib/glfw/src/win32_init.c", "lib/glfw/src/win32_joystick.c", "lib/glfw/src/win32_monitor.c", "lib/glfw/src/win32_time.c", "lib/glfw/src/win32_thread.c", "lib/glfw/src/win32_window.c", "lib/glfw/src/wgl_context.c", "lib/glfw/src/egl_context.c", "lib/glfw/src/osmesa_context.c", "lib/glfw/src/context.c", "lib/glfw/src/init.c", "lib/glfw/src/input.c", "lib/glfw/src/monitor.c", "lib/glfw/src/vulkan.c", "lib/glfw/src/window.c"
|
||||
}, &[_][]const u8{"-gdwarf-4", "-std=c99", "-D_GLFW_WIN32"});
|
||||
}, &[_][]const u8{"-g", "-std=c99", "-D_GLFW_WIN32"});
|
||||
exe.linkSystemLibrary("gdi32");
|
||||
exe.linkSystemLibrary("opengl32");
|
||||
exe.linkSystemLibrary("ws2_32");
|
||||
@ -26,11 +26,11 @@ pub fn build(b: *std.build.Builder) void {
|
||||
// TODO: if(isWayland) {
|
||||
// exe.addCSourceFiles(&[_][]const u8 {
|
||||
// "lib/glfw/src/linux_joystick.c", "lib/glfw/src/wl_init.c", "lib/glfw/src/wl_monitor.c", "lib/glfw/src/wl_window.c", "lib/glfw/src/posix_time.c", "lib/glfw/src/posix_thread.c", "lib/glfw/src/xkb_unicode.c", "lib/glfw/src/egl_context.c", "lib/glfw/src/osmesa_context.c", "lib/glfw/src/context.c", "lib/glfw/src/init.c", "lib/glfw/src/input.c", "lib/glfw/src/monitor.c", "lib/glfw/src/vulkan.c", "lib/glfw/src/window.c"
|
||||
// }, &[_][]const u8{"-gdwarf-4",});
|
||||
// }, &[_][]const u8{"-g",});
|
||||
//} else {
|
||||
exe.addCSourceFiles(&[_][]const u8 {
|
||||
"lib/glfw/src/linux_joystick.c", "lib/glfw/src/x11_init.c", "lib/glfw/src/x11_monitor.c", "lib/glfw/src/x11_window.c", "lib/glfw/src/xkb_unicode.c", "lib/glfw/src/posix_time.c", "lib/glfw/src/posix_thread.c", "lib/glfw/src/glx_context.c", "lib/glfw/src/egl_context.c", "lib/glfw/src/osmesa_context.c", "lib/glfw/src/context.c", "lib/glfw/src/init.c", "lib/glfw/src/input.c", "lib/glfw/src/monitor.c", "lib/glfw/src/vulkan.c", "lib/glfw/src/window.c"
|
||||
}, &[_][]const u8{"-gdwarf-4", "-std=c99", "-D_GLFW_X11"});
|
||||
}, &[_][]const u8{"-g", "-std=c99", "-D_GLFW_X11"});
|
||||
exe.linkSystemLibrary("x11");
|
||||
//}
|
||||
exe.linkSystemLibrary("GL");
|
||||
@ -38,7 +38,7 @@ pub fn build(b: *std.build.Builder) void {
|
||||
std.log.err("Unsupported target: {}\n", .{ target.getOsTag() });
|
||||
}
|
||||
}
|
||||
exe.addCSourceFiles(&[_][]const u8{"lib/glad.c", "lib/stb_image.c", "lib/cross_platform_udp_socket.c"}, &[_][]const u8{"-gdwarf-4"});
|
||||
exe.addCSourceFiles(&[_][]const u8{"lib/glad.c", "lib/stb_image.c", "lib/cross_platform_udp_socket.c"}, &[_][]const u8{"-g"});
|
||||
exe.setTarget(target);
|
||||
exe.setBuildMode(mode);
|
||||
//exe.sanitize_thread = true;
|
||||
|
@ -43,7 +43,11 @@ int init(unsigned short localPort) {
|
||||
bindingAddr.sin_addr.s_addr = INADDR_ANY;
|
||||
memset(&bindingAddr.sin_zero, 0, 8);
|
||||
if(checkError(bind(socketID, (const struct sockaddr*)&bindingAddr, sizeof(bindingAddr))) == -1) {
|
||||
#ifdef _WIN32
|
||||
closesocket(socketID);
|
||||
#else
|
||||
close(socketID);
|
||||
#endif
|
||||
return -1;
|
||||
};
|
||||
return socketID;
|
||||
|
Loading…
x
Reference in New Issue
Block a user