mirror of https://github.com/mgba-emu/mgba.git
3DS: Add CMakeToolchain for 3DS
This commit is contained in:
parent
ed8852bbe0
commit
eb2315cdd8
|
@ -0,0 +1,35 @@
|
|||
if(DEFINED ENV{DEVKITPRO})
|
||||
set(DEVKITPRO $ENV{DEVKITPRO})
|
||||
else()
|
||||
message(FATAL_ERROR "Could not find DEVKITPRO in environment")
|
||||
endif()
|
||||
|
||||
if(ENV{DEVKITARM)
|
||||
set(DEVKITARM $ENV{DEVKITARM})
|
||||
else()
|
||||
set(DEVKITARM ${DEVKITPRO}/devkitARM)
|
||||
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(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_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(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")
|
||||
set(CMAKE_LINKER ${cross_prefix}ld)
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS ${link_flags} CACHE INTERNAL "exe link flags")
|
||||
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)
|
Loading…
Reference in New Issue