Fix windows build

This commit is contained in:
Simon Gellis 2024-10-15 01:06:52 -04:00
parent 8ec65dc6ae
commit ce01974243
8 changed files with 49 additions and 36 deletions

12
.gitattributes vendored Normal file
View File

@ -0,0 +1,12 @@
*.c text eol=lf diff=c
*.css text eol=lf diff=css
*.h text eol=lf diff=c
*.html text eol=lf diff=html
*.java text eol=lf diff=java
*.js text eol=lf diff=js
*.txt text eol=lf
*.class binary
*.dll binary
*.wasm binary
*.woff2 binary

4
.gitignore vendored
View File

@ -1,3 +1,3 @@
/shrooms-vb
/shrooms-vb.exe
/shrooms-vb
/shrooms-vb.exe
.vscode

2
.gitmodules vendored
View File

@ -1,3 +1,3 @@
[submodule "shrooms-vb-core"]
[submodule "shrooms-vb-core"]
path = shrooms-vb-core
url = https://git.virtual-boy.com/PVB/shrooms-vb-core.git

View File

@ -1,15 +1,15 @@
# Shrooms VB (native)
An SDL-based implementation of shrooms-vb.
## Setup
Install the following dependencies:
- `gcc` (or MinGW on Windows) (or whatever, just set `CC`)
- `pkg-config`
- sdl2
Run
```sh
make build
# Shrooms VB (native)
An SDL-based implementation of shrooms-vb.
## Setup
Install the following dependencies:
- `gcc` (or MinGW on Windows) (or whatever, just set `CC`)
- `pkg-config`
- sdl2
Run
```sh
make build
```

2
game.h
View File

@ -1,7 +1,7 @@
#ifndef SHROOMS_VB_NATIVE_GAME_
#define SHROOMS_VB_NATIVE_GAME_
#include <vb.h>
#include "shrooms-vb-core/core/vb.h"
int runGame(VB *sim);

2
main.c
View File

@ -97,4 +97,4 @@ int main(int argc, char **argv) {
SDL_Quit();
return status;
}
}

View File

@ -1,18 +1,18 @@
CC?=gcc
SHROOMSFLAGS=shrooms-vb-core/core/vb.c -I shrooms-vb-core/core
SDL2FLAGS=$(shell pkg-config sdl2 --cflags --libs)
.PHONY: clean
clean:
ifeq ($(OS),WINDOWS_NT)
@del shrooms-vb.exe
else
@rm -f shrooms-vb
endif
build:
@$(CC) cli.c game.c main.c -I . \
$(SHROOMSFLAGS) $(SDL2FLAGS) \
-D POSIX_C_SOURCE=199309L \
-o shrooms-vb \
CC?=gcc
SHROOMSFLAGS=shrooms-vb-core/core/vb.c -I shrooms-vb-core/core
SDL2FLAGS=$(shell pkg-config sdl2 --cflags --libs)
.PHONY: clean
clean:
ifeq ($(OS),WINDOWS_NT)
@del shrooms-vb.exe
else
@rm -f shrooms-vb
endif
build:
@$(CC) cli.c game.c main.c -I . \
$(SHROOMSFLAGS) $(SDL2FLAGS) \
-D POSIX_C_SOURCE=199309L \
-o shrooms-vb \
-Werror -std=c90 -Wall -Wextra -Wpedantic

1
shrooms-vb-core Submodule

@ -0,0 +1 @@
Subproject commit 767675eb42254613170e937b5b67bd9c109a9cf8