Skip to content

Commit

Permalink
Merge pull request #11 from Stenodyon/png
Browse files Browse the repository at this point in the history
Replace SOIL with lodepng
  • Loading branch information
Kévin Le Run authored Dec 7, 2019
2 parents 1766dec + 9acf38d commit 9a236ac
Show file tree
Hide file tree
Showing 9 changed files with 8,356 additions and 28 deletions.
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@ I am considering closing the sources until well after the 1.0 release, and
releasing the game for a small price. As such, **I will not accept any
contributions for the time being**.

## Cloning

This project uses the [Lazy-Zig](https://github.com/BraedonWooding/Lazy-Zig)
library as a git submodule. Once cloned, run

```
git submodule update --init --recursive
```

## Building
Dependencies:

Expand Down
23 changes: 16 additions & 7 deletions build.zig
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
const Builder = @import("std").build.Builder;
const builtin = @import("builtin");

const CFLAGS = [_][]const u8{"-O2"};

pub fn build(b: *Builder) void {
const mode = b.standardReleaseOptions();
const windows = b.option(
bool,
"windows",
"create windows build",
"cross-compile to Microsoft Windows",
) orelse false;

var exe = b.addExecutable("blink", "src/main.zig");
exe.setBuildMode(mode);
exe.addIncludeDir("include");
exe.addCSourceFile("src/lodepng.c", CFLAGS[0..]);
if (windows) {
exe.setTarget(
builtin.Arch.x86_64,
builtin.Os.windows,
builtin.Abi.gnu,
);
exe.addIncludeDir("/usr/include");
}

exe.addObjectFile("lib/libSDL2main.a");
exe.addObjectFile("lib/libSDL2.dll.a");
exe.addObjectFile("lib/libSDL2_ttf.dll.a");
exe.addObjectFile("lib/libopengl32.a");
exe.addObjectFile("lib/epoxy.lib");
} else {
exe.linkSystemLibrary("SDL2");
exe.linkSystemLibrary("SDL2_ttf");
exe.linkSystemLibrary("GL");
exe.linkSystemLibrary("epoxy");
}
exe.linkSystemLibrary("c");
exe.linkSystemLibrary("SDL2");
exe.linkSystemLibrary("SDL2_ttf");
exe.linkSystemLibrary("GL");
exe.linkSystemLibrary("epoxy");
exe.linkSystemLibrary("SOIL");

exe.setOutputDir(".");

Expand Down
Loading

0 comments on commit 9a236ac

Please sign in to comment.