all repos — mgba @ 7f904876f57d862dfeea232c3591d27cb6f39c0c

mGBA Game Boy Advance Emulator

src/platform/3ds/CMakeToolchain.txt (view raw)

 1if(DEFINED ENV{DEVKITPRO})
 2	set(DEVKITPRO $ENV{DEVKITPRO})
 3else()
 4	message(FATAL_ERROR "Could not find DEVKITPRO in environment")
 5endif()
 6
 7if(DEFINED ENV{DEVKITARM})
 8	set(DEVKITARM $ENV{DEVKITARM})
 9else()
10	set(DEVKITARM ${DEVKITPRO}/devkitARM)
11endif()
12
13set(toolchain_bin_dir ${DEVKITARM}/bin)
14set(cross_prefix ${toolchain_bin_dir}/arm-none-eabi-)
15set(inc_flags -I${DEVKITPRO}/libctru/include)
16set(arch_flags "-march=armv6k -mtune=mpcore -mfpu=vfp -mfloat-abi=hard")
17set(link_flags "-L${DEVKITPRO}/libctru/lib -lctru -lm -specs=3dsx.specs ${arch_flags}")
18
19set(CMAKE_SYSTEM_NAME Generic CACHE INTERNAL "system name")
20set(CMAKE_SYSTEM_PROCESSOR arm CACHE INTERNAL "processor")
21set(CMAKE_LIBRARY_ARCHITECTURE arm-none-eabi CACHE INTERNAL "abi")
22set(CMAKE_AR ${cross_prefix}gcc-ar CACHE INTERNAL "archiver")
23set(CMAKE_RANLIB ${cross_prefix}gcc-ranlib CACHE INTERNAL "ranlib")
24set(CMAKE_C_COMPILER ${cross_prefix}gcc CACHE INTERNAL "c compiler")
25set(CMAKE_CXX_COMPILER ${cross_prefix}g++ CACHE INTERNAL "cxx compiler")
26set(CMAKE_ASM_COMPILER ${cross_prefix}gcc CACHE INTERNAL "assembler")
27set(common_flags "${arch_flags} -mword-relocations ${inc_flags}")
28set(CMAKE_C_FLAGS ${common_flags} CACHE INTERNAL "c compiler flags")
29set(CMAKE_C_FLAGS_RELEASE -Ofast CACHE INTERNAL "c compiler flags (release)")
30set(CMAKE_ASM_FLAGS ${common_flags} CACHE INTERNAL "c compiler flags")
31set(CMAKE_CXX_FLAGS ${common_flags} CACHE INTERNAL "cxx compiler flags")
32set(CMAKE_LINKER ${cross_prefix}ld CACHE INTERNAL "linker")
33
34set(CMAKE_EXE_LINKER_FLAGS ${link_flags} CACHE INTERNAL "exe link flags")
35set(CMAKE_MODULE_LINKER_FLAGS ${link_flags} CACHE INTERNAL "module link flags")
36set(CMAKE_SHARED_LINKER_FLAGS ${link_flags} CACHE INTERNAL "shared link flags")
37
38set(3DSLINK ${toolchain_bin_dir}/3dslink)
39set(3DSXTOOL ${toolchain_bin_dir}/3dsxtool)
40set(BANNERTOOL ${toolchain_bin_dir}/bannertool)
41set(MAKEROM ${toolchain_bin_dir}/makerom)
42set(RAW2C ${toolchain_bin_dir}/raw2c)
43set(SMDHTOOL ${toolchain_bin_dir}/smdhtool)
44set(STRIP ${cross_prefix}strip)
45
46set(3DS ON)
47add_definitions(-D_3DS -DARM11)