mirror of https://github.com/mgba-emu/mgba.git
3DS: Update CMakeToolchain with properties from devkitARM makefiles
This commit is contained in:
parent
b2a4780b17
commit
4748ef7d5d
|
@ -13,16 +13,17 @@ endif()
|
|||
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)
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#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 @@ static void _vfdUnmap(struct VFile* vf, void* memory, size_t size) {
|
|||
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;
|
||||
|
|
Loading…
Reference in New Issue