Fix iOS and lib builds

This commit is contained in:
Lior Halphon
2024-08-29 01:26:13 +03:00
parent 6178ff2a78
commit 5b33cebca9
2 changed files with 13 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ extern "C" {
#include <stdalign.h>
#include <time.h>
#ifndef GB_DISABLE_CHEAT_SEARCH
#ifdef GB_DISABLE_CHEATS
#define GB_DISABLE_CHEAT_SEARCH
#else
@@ -16,6 +17,7 @@ extern "C" {
#define GB_DISABLE_CHEAT_SEARCH
#endif
#endif
#endif
#include "model.h"
#include "defs.h"

View File

@@ -71,6 +71,7 @@ ifneq ($(DISABLE_DEBUGGER),)
CFLAGS += -DGB_DISABLE_DEBUGGER
CPPP_FLAGS += -DGB_DISABLE_DEBUGGER
CORE_FILTER += Core/debugger.c Core/sm83_disassembler.c Core/symbol_hash.c
DISABLE_CHEAT_SEARCH := 1
else
CPPP_FLAGS += -UGB_DISABLE_DEBUGGER
endif
@@ -79,10 +80,19 @@ ifneq ($(DISABLE_CHEATS),)
CFLAGS += -DGB_DISABLE_CHEATS
CPPP_FLAGS += -DGB_DISABLE_CHEATS
CORE_FILTER += Core/cheats.c
DISABLE_CHEAT_SEARCH := 1
else
CPPP_FLAGS += -UGB_DISABLE_CHEATS
endif
ifneq ($(DISABLE_CHEAT_SEARCH),)
CFLAGS += -DGB_DISABLE_CHEAT_SEARCH
CPPP_FLAGS += -DGB_DISABLE_CHEAT_SEARCH
CORE_FILTER += Core/cheat_search.c
else
CPPP_FLAGS += -UGB_DISABLE_CHEAT_SEARCH
endif
ifneq ($(CORE_FILTER)$(DISABLE_TIMEKEEPING),)
ifneq ($(MAKECMDGOALS),lib)
$(error SameBoy features can only be disabled when compiling the 'lib' target)
@@ -268,7 +278,7 @@ ifeq ($(SYSROOT),)
$(error Could not find an iOS SDK)
endif
CFLAGS += -arch arm64 -miphoneos-version-min=$(IOS_MIN) -isysroot $(SYSROOT) -IAppleCommon -DGB_DISABLE_DEBUGGER
CORE_FILTER += Core/debugger.c Core/sm83_disassembler.c Core/symbol_hash.c
CORE_FILTER += Core/debugger.c Core/sm83_disassembler.c Core/symbol_hash.c Core/cheat_search.c
LDFLAGS += -arch arm64
OCFLAGS += -x objective-c -fobjc-arc -Wno-deprecated-declarations -isysroot $(SYSROOT)
LDFLAGS += -miphoneos-version-min=$(IOS_MIN) -isysroot $(SYSROOT)