Skip to content

fix SDL_config.h errors on older glibc #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
# SDL for Zig

This is a fork of [SDL](https://www.libsdl.org/), packaged for [Zig](https://ziglang.org).
Unnecessary files have been deleted, and the build system has been replaced with `build.zig`.
The package provides version 2 of SDL. For version 3, consider https://github.com/castholm/SDL.

## Getting started

### Linking SDL2 to your project

Fetch SDL and add to your `build.zig.zon` :
```bash
zig fetch --save=SDL git+https://github.com/allyourcodebase/SDL
```

Add this to your `build.zig` :
```zig
pub fn build(b: *std.Build) void {
// ...

const sdl_dep = b.dependency("SDL", .{
.optimize = .ReleaseFast,
.target = target,
});

// ...

exe.linkLibrary(sdl_dep.artifact("SDL2"));

// ...
}
```
8 changes: 4 additions & 4 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1082,8 +1082,8 @@ fn configHeader(b: *std.Build, t: std.Target) *std.Build.Step.ConfigHeader {
.HAVE_MEMMOVE = 1,
.HAVE_MEMCMP = 1,
.HAVE_WCSLEN = 1,
.HAVE_WCSLCPY = !is_musl,
.HAVE_WCSLCAT = !is_musl,
.HAVE_WCSLCPY = !is_linux and !is_musl,
.HAVE_WCSLCAT = !is_linux and !is_musl,
.HAVE__WCSDUP = 0,
.HAVE_WCSDUP = 1,
.HAVE_WCSSTR = 1,
Expand All @@ -1094,8 +1094,8 @@ fn configHeader(b: *std.Build, t: std.Target) *std.Build.Step.ConfigHeader {
.HAVE_WCSNCASECMP = 1,
.HAVE__WCSNICMP = 0,
.HAVE_STRLEN = 1,
.HAVE_STRLCPY = 1,
.HAVE_STRLCAT = 1,
.HAVE_STRLCPY = !is_linux,
.HAVE_STRLCAT = !is_linux,
.HAVE__STRREV = 0,
.HAVE__STRUPR = 0,
.HAVE__STRLWR = 0,
Expand Down