3DS: Update CMakeToolchain with properties from devkitARM makefiles
Jeffrey Pfau jeffrey@endrift.com
Mon, 08 Dec 2014 18:36:52 -0800
2 files changed,
7 insertions(+),
5 deletions(-)
M
src/platform/3ds/CMakeToolchain.txt
→
src/platform/3ds/CMakeToolchain.txt
@@ -13,16 +13,17 @@
set(toolchain_bin_dir ${DEVKITARM}/bin) set(cross_prefix ${toolchain_bin_dir}/arm-none-eabi-) set(inc_flags -I${DEVKITPRO}/libcrtu/include) -set(link_flags -L${DEVKITPRO}/libcrtu/lib) +set(arch_flags "-march=armv6k -mtune=mpcore -mfpu=vfp -mfloat-abi=softfp") +set(link_flags "-L${DEVKITPRO}/libcrtu/lib -lctru -lm -specs=3dsx.specs ${arch_flags}") set(CMAKE_SYSTEM_NAME Unknown CACHE INTERNAL "system name") set(CMAKE_SYSTEM_PROCESSOR arm CACHE INTERNAL "processor") set(CMAKE_LIBRARY_ARCHITECTURE arm-none-eabi CACHE INTERNAL "abi") -set(CMAKE_AR ${cross_prefix}ar CACHE FILEPATH "archiver") +set(CMAKE_AR ${cross_prefix}ar) set(CMAKE_C_COMPILER ${cross_prefix}gcc) set(CMAKE_CXX_COMPILER ${cross_prefix}g++) set(CMAKE_ASM_COMPILER ${cross_prefix}gcc) -set(common_flags "-march=armv6k -mtune=mpcore -mfpu=vfp ${inc_flags}") +set(common_flags "${arch_flags} -mword-relocations ${inc_flags}") set(CMAKE_C_FLAGS ${common_flags} CACHE INTERNAL "c compiler flags") set(CMAKE_ASM_FLAGS ${common_flags} CACHE INTERNAL "c compiler flags") set(CMAKE_CXX_FLAGS ${common_flags} CACHE INTERNAL "cxx compiler flags")@@ -33,3 +34,4 @@ set(CMAKE_MODULE_LINKER_FLAGS ${link_flags} CACHE INTERNAL "module link flags")
set(CMAKE_SHARED_LINKER_FLAGS ${link_flags} CACHE INTERNAL "shared link flags") set(3DS ON) +add_definitions(-D_3DS -DARM11)
M
src/util/vfs.c
→
src/util/vfs.c
@@ -14,7 +14,7 @@ #ifdef _WIN32
#include <io.h> #include <windows.h> #define PATH_SEP '\\' -#elif defined(__3DS) +#elif defined(_3DS) #define PATH_SEP '/' #else #include <sys/mman.h>@@ -142,7 +142,7 @@ UnmapViewOfFile(memory);
CloseHandle(vfd->hMap); vfd->hMap = 0; } -#elif defined(__3DS) +#elif defined(_3DS) #else static void* _vfdMap(struct VFile* vf, size_t size, int flags) { struct VFileFD* vfd = (struct VFileFD*) vf;