src/platform/wii/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{DEVKITPPC})
8 set(DEVKITPPC $ENV{DEVKITPPC})
9else()
10 set(DEVKITPPC ${DEVKITPRO}/devkitPPC)
11endif()
12
13set(toolchain_bin_dir ${DEVKITPPC}/bin)
14set(cross_prefix ${toolchain_bin_dir}/powerpc-eabi-)
15set(inc_flags -I${DEVKITPRO}/libogc/include)
16set(arch_flags "-mrvl -mcpu=750 -meabi -mhard-float -g")
17set(link_flags "-L${DEVKITPRO}/libogc/lib/wii ${arch_flags}")
18
19set(CMAKE_SYSTEM_NAME Generic CACHE INTERNAL "system name")
20set(CMAKE_SYSTEM_PROCESSOR arm CACHE INTERNAL "processor")
21set(CMAKE_LIBRARY_ARCHITECTURE powerpc-none-eabi CACHE INTERNAL "abi")
22set(CMAKE_AR ${cross_prefix}ar CACHE INTERNAL "archiver")
23set(CMAKE_C_COMPILER ${cross_prefix}gcc CACHE INTERNAL "c compiler")
24set(CMAKE_CXX_COMPILER ${cross_prefix}g++ CACHE INTERNAL "cxx compiler")
25set(CMAKE_ASM_COMPILER ${cross_prefix}gcc CACHE INTERNAL "assembler")
26set(common_flags "${arch_flags} ${inc_flags}")
27set(CMAKE_C_FLAGS ${common_flags} CACHE INTERNAL "c compiler flags")
28set(CMAKE_ASM_FLAGS ${common_flags} CACHE INTERNAL "c compiler flags")
29set(CMAKE_CXX_FLAGS ${common_flags} CACHE INTERNAL "cxx compiler flags")
30set(CMAKE_LINKER ${cross_prefix}ld CACHE INTERNAL "linker")
31
32set(CMAKE_EXE_LINKER_FLAGS ${link_flags} CACHE INTERNAL "exe link flags")
33set(CMAKE_MODULE_LINKER_FLAGS ${link_flags} CACHE INTERNAL "module link flags")
34set(CMAKE_SHARED_LINKER_FLAGS ${link_flags} CACHE INTERNAL "shared link flags")
35
36set(ELF2DOL ${toolchain_bin_dir}/elf2dol)
37
38set(WII ON)
39add_definitions(-DGEKKO)