From 8ab698782386bd21f45ccc61bfd71dcafa4b0ce2 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Mon, 27 Nov 2017 12:58:33 -0800 Subject: [PATCH] CMake: Build fixes --- CMakeLists.txt | 3 ++- include/mgba/core/cheats.h | 5 +++-- src/core/cheats.c | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 82825f02a..7d7f99e5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -502,6 +502,7 @@ if(USE_ZLIB) list(APPEND DEPENDENCY_LIB ${ZLIB_LIBRARIES}) set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},zlib1g") set(HAVE_CRC32 ON) + list(APPEND OS_LIB ${ZLIB_LIBRARIES}) else() # zlib pulls in crc32 check_function_exists(crc32 HAVE_CRC32) @@ -819,7 +820,7 @@ if(BUILD_OPENEMU) find_library(FOUNDATION Foundation) find_library(OPENEMUBASE OpenEmuBase) file(GLOB OE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/platform/openemu/*.m) - add_library(${BINARY_NAME}-openemu MODULE ${CORE_SRC} ${OE_SRC}) + add_library(${BINARY_NAME}-openemu MODULE ${CORE_SRC} ${OS_SRC}) set_target_properties(${BINARY_NAME}-openemu PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/src/platform/openemu/Info.plist.in BUNDLE TRUE diff --git a/include/mgba/core/cheats.h b/include/mgba/core/cheats.h index 98eb4dd91..32c7cad42 100644 --- a/include/mgba/core/cheats.h +++ b/include/mgba/core/cheats.h @@ -14,8 +14,6 @@ CXX_GUARD_START #include #include -#define MAX_ROM_PATCHES 4 - enum mCheatType { CHEAT_ASSIGN, CHEAT_ASSIGN_INDIRECT, @@ -101,7 +99,10 @@ void mCheatRemoveSet(struct mCheatDevice*, struct mCheatSet*); bool mCheatParseFile(struct mCheatDevice*, struct VFile*); bool mCheatSaveFile(struct mCheatDevice*, struct VFile*); + +#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2 void mCheatAutosave(struct mCheatDevice*); +#endif void mCheatRefresh(struct mCheatDevice*, struct mCheatSet*); void mCheatPressButton(struct mCheatDevice*, bool down); diff --git a/src/core/cheats.c b/src/core/cheats.c index a9aa253f4..4f5b38695 100644 --- a/src/core/cheats.c +++ b/src/core/cheats.c @@ -254,6 +254,7 @@ bool mCheatSaveFile(struct mCheatDevice* device, struct VFile* vf) { return true; } +#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2 void mCheatAutosave(struct mCheatDevice* device) { if (!device->autosave) { return; @@ -262,6 +263,7 @@ void mCheatAutosave(struct mCheatDevice* device) { mCheatSaveFile(device, vf); vf->close(vf); } +#endif void mCheatRefresh(struct mCheatDevice* device, struct mCheatSet* cheats) { if (!cheats->enabled) {