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
/shrooms-vb.exe /shrooms-vb.exe
.vscode .vscode

2
.gitmodules vendored
View File

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

View File

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

2
game.h
View File

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

2
main.c
View File

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

View File

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

1
shrooms-vb-core Submodule

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