Added icon and version information to Windows port

This commit is contained in:
Lior Halphon 2016-08-20 22:59:03 +03:00
parent 44dfb60c9c
commit 276fe53385
3 changed files with 34 additions and 3 deletions

View File

@ -36,7 +36,7 @@ CFLAGS += -Werror -Wall -std=gnu11 -ICore -D_GNU_SOURCE -DVERSION="$(VERSION)" -
SDL_LDFLAGS := -lSDL
ifeq ($(PLATFORM),windows32)
CFLAGS += -IWindows
LDFLAGS += -lmsvcrt -lSDLmain
LDFLAGS += -lmsvcrt -lSDLmain -Wl,/MANIFESTFILE:NUL
else
LDFLAGS += -lc -lm
endif
@ -169,14 +169,21 @@ ifeq ($(CONF), release)
endif
# Windows version builds two, one with a conole and one without it
$(BIN)/sdl/sameboy.exe: $(CORE_OBJECTS) $(SDL_OBJECTS)
$(BIN)/sdl/sameboy.exe: $(CORE_OBJECTS) $(SDL_OBJECTS) $(OBJ)/Windows/resources.o
-@$(MKDIR) -p $(dir $@)
$(CC) $^ -o $@ $(LDFLAGS) $(SDL_LDFLAGS) -Wl,/subsystem:windows
$(BIN)/sdl/sameboy_debugger.exe: $(CORE_OBJECTS) $(SDL_OBJECTS)
$(BIN)/sdl/sameboy_debugger.exe: $(CORE_OBJECTS) $(SDL_OBJECTS) $(OBJ)/Windows/resources.o
-@$(MKDIR) -p $(dir $@)
$(CC) $^ -o $@ $(LDFLAGS) $(SDL_LDFLAGS) -Wl,/subsystem:console
$(OBJ)/%.res: %.rc
-@$(MKDIR) -p $(dir $@)
rc /fo $@ /dVERSION=\"$(VERSION)\" $^
%.o: %.res
cvtres /OUT:"$@" $^
# We must provide SDL.dll with the Windows port. This is an AWFUL HACK to find it.
SPACE :=
SPACE +=

24
Windows/resources.rc Normal file
View File

@ -0,0 +1,24 @@
1 VERSIONINFO
FILEOS 0x4
FILETYPE 0x1
{
BLOCK "StringFileInfo"
{
BLOCK "040904E4"
{
VALUE "CompanyName", "Lior Halphon"
VALUE "FileDescription", "SameBoy"
VALUE "FileVersion", VERSION
VALUE "LegalCopyright", "Copyright © 2015-2016 Lior Halphon"
VALUE "ProductName", "SameBoy"
VALUE "ProductVersion", VERSION
VALUE "WWW", "https://github.com/LIJI32/SameBoy"
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 0x0409 0x04E4
}
}
IDI_ICON1 ICON DISCARDABLE "SameBoy.ico"

BIN
Windows/sameboy.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB