Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/bl/api/extra/sdl3/sdl3.bl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ MouseID :: u32;
Surface :: u8;
DisplayID :: u32;

HINT_VIDEO_DRIVER :: "SDL_VIDEO_DRIVER";
HINT_VIDEO_DRIVER :: "SDL_HINT_VIDEO_DRIVER";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to docs https://wiki.libsdl.org/SDL3/SDL_HINT_VIDEO_DRIVER this should be SDL_VIDEO_DRIVER, accepting list of drivers separated by comma. Your Tine build probably works because the hint is ignored?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe there should not be space after the comma in the list? https://github.com/travisdoor/tine/blob/db44045a22bb9ff1a59be1a0f8566c9ce8c035db/src/window.bl#L38 IDK.

HINT_VIDEO_WAYLAND_PREFER_LIBDECOR :: "SDL_VIDEO_WAYLAND_PREFER_LIBDECOR";
HINT_MOUSE_RELATIVE_MODE_CENTER :: "SDL_MOUSE_RELATIVE_MODE_CENTER";

Expand Down Expand Up @@ -1388,4 +1388,4 @@ Vulkan_DestroySurface :: fn (instance: VkInstance, surface: VkSurfaceKHR, alloca
Vulkan_GetInstanceExtensions :: fn (count: *u32) **C.char #extern "SDL_Vulkan_GetInstanceExtensions";

#scope_module
C :: #import "libc";
C :: #import "libc";
7 changes: 4 additions & 3 deletions src/nob/nob.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ void blc(void) {
cmd_append(&cmd, "-O3", "-DNDEBUG");
}
#else
cmd_append(&cmd, "-fdiagnostics-color=always", "-D_GNU_SOURCE", "-Wall", "-Wno-address", "-Wno-unused-value", "-Wno-unused-function", "-Wno-multistatement-macros");
cmd_append(&cmd, "-fdiagnostics-color=always", "-D_GNU_SOURCE", "-Wall", "-Wno-address", "-Wno-unused-value", "-Wno-unused-function", "-Wno-multistatement-macros", "-pthread");
if (IS_DEBUG) {
cmd_append(&cmd, "-O0", "-ggdb", "-DBL_DEBUG");
} else {
Expand All @@ -244,7 +244,7 @@ void blc(void) {
#ifdef __APPLE__
cmd_append(&cmd, "c++", "-arch", "arm64", "-lm", "-mmacosx-version-min=14.3");
#else
cmd_append(&cmd, "c++", "-D_GNU_SOURCE", "-lrt", "-ldl", "-lm", "-rdynamic", "-Wl,--export-dynamic");
cmd_append(&cmd, "c++", "-D_GNU_SOURCE", "-lrt", "-ldl", "-lm", "-lpthread", "-rdynamic", "-Wl,--export-dynamic");
#endif

for (int i = 0; i < files.count; ++i) {
Expand All @@ -262,6 +262,7 @@ void blc(void) {
cmd_append(&cmd, LIBZ, LIBZSTD, LIBCURSES);
#else
cmd_append(&cmd, LIBZ, LIBZSTD, LIBTINFO);
cmd_append(&cmd, "-ldl", "-lm", "-lpthread");
Copy link
Collaborator

@travisdoor travisdoor Jul 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cause all listed flags to be added second time, I guess it can be removed. Let me know if there are any other issues (maybe something with ordering of link flags?). Also there is incorrect indentation; use tabs please.

#endif
cmd_append(&cmd, "-o", BIN_DIR "/blc");

Expand Down Expand Up @@ -439,4 +440,4 @@ void db_add_entry(const char *file, Cmd cmd) {
sb_append_cstr(&db, "\"\n");
sb_append_cstr(&db, "}");
}
#endif
#endif