3DS: Progress on 3DS linking

This commit is contained in:
Jeffrey Pfau 2014-12-08 18:42:13 -08:00
parent 03de43511f
commit 2aae3dc660
2 changed files with 19 additions and 2 deletions

View File

@ -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

14
src/platform/3ds/memory.c Normal file
View File

@ -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);
}