Fix macOS builds being broken (#489)

also add .DS_Store to .gitignore
This commit is contained in:
Xenthio 2021-11-30 12:24:54 +11:00 committed by GitHub
parent 59adb5c634
commit fa49c7bc59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

3
.gitignore vendored
View File

@ -78,3 +78,6 @@ sm64config.txt
!/sound/**/*custom*/**/*.aiff
!/assets/**/*custom*.bin
!/assets/**/*custom*/**/*.bin
# macOS bullcrap directory settings file thats autocreated
.DS_Store

View File

@ -532,7 +532,12 @@ else ifeq ($(SDL1_USED),1)
endif
ifneq ($(SDL1_USED)$(SDL2_USED),00)
BACKEND_CFLAGS += `$(SDLCONFIG) --cflags`
ifeq ($(OSX_BUILD),1)
MAC_PREFIX := `$(SDLCONFIG) --prefix`
BACKEND_CFLAGS +=-I$(MAC_PREFIX)/include `$(SDLCONFIG) --cflags` # macOS homebrew SDL2 has the config laid out differently so this makes it point to the correct folder + a failsafe for if it ever changes for some reason in the future.
else
BACKEND_CFLAGS += `$(SDLCONFIG) --cflags`
endif
ifeq ($(WINDOWS_BUILD),1)
BACKEND_LDFLAGS += `$(SDLCONFIG) --static-libs` -lsetupapi -luser32 -limm32 -lole32 -loleaut32 -lshell32 -lwinmm -lversion
else

View File

@ -26,6 +26,11 @@ typedef unsigned int u32;
#define NORETURN __attribute__((noreturn))
#define UNUSED __attribute__((unused))
#ifdef __APPLE__
// even with -std=gnu99 vsnprintf seems to not be defined in stdio.h, why?
extern int vsnprintf(char * __restrict, size_t, const char * __restrict, va_list);
#endif
typedef struct
{
u32 start;