From 2aae3dc6601ec7ff19a2577f8aa7031e2a5a34f6 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Mon, 8 Dec 2014 18:42:13 -0800 Subject: [PATCH] 3DS: Progress on 3DS linking --- CMakeLists.txt | 7 +++++-- src/platform/3ds/memory.c | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 src/platform/3ds/memory.c diff --git a/CMakeLists.txt b/CMakeLists.txt index c6050fdee..7087fb054 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,7 +112,10 @@ elseif(UNIX) list(APPEND OS_LIB pthread) file(GLOB OS_SRC ${CMAKE_SOURCE_DIR}/src/platform/posix/*.c) source_group("POSIX-specific code" FILES ${OS_SRC}) -else() +elseif(3DS) + list(APPEND OS_LIB ctru) + list(APPEND OS_SRC ${CMAKE_SOURCE_DIR}/src/platform/3ds/memory.c) + source_group("3DS-specific code" FILES ${OS_SRC}) set(BINARY_TYPE STATIC) endif() @@ -215,7 +218,7 @@ endif() if(3DS) add_executable(${BINARY_NAME}-elf ${CMAKE_SOURCE_DIR}/src/platform/3ds/main.c) - target_link_libraries(${BINARY_NAME}-elf ${BINARY_NAME} -lctru) + target_link_libraries(${BINARY_NAME}-elf ${BINARY_NAME} m ${OS_LIB}) endif() # Packaging diff --git a/src/platform/3ds/memory.c b/src/platform/3ds/memory.c new file mode 100644 index 000000000..e11da7da1 --- /dev/null +++ b/src/platform/3ds/memory.c @@ -0,0 +1,14 @@ +/* Copyright (c) 2013-2014 Jeffrey Pfau + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include "util/memory.h" + +void* anonymousMemoryMap(size_t size) { + return malloc(size); +} + +void mappedMemoryFree(void* memory, size_t size) { + free(memory); +}