all repos — mgba @ 45a51010993ad38628cd955c64f51fb9a83e2ca7

mGBA Game Boy Advance Emulator

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(extension)
14if (CMAKE_HOST_WIN32)
15	set(extension .exe)
16endif()
17
18set(CMAKE_PROGRAM_PATH ${DEVKITPPC}/bin)
19set(cross_prefix powerpc-eabi-)
20set(arch_flags "-mrvl -mcpu=750 -meabi -mhard-float -g")
21set(inc_flags "-I${DEVKITPRO}/libogc/include ${arch_flags}")
22set(link_flags "-L${DEVKITPRO}/libogc/lib/wii ${arch_flags}")
23
24set(CMAKE_SYSTEM_NAME Generic CACHE INTERNAL "system name")
25set(CMAKE_SYSTEM_PROCESSOR powerpc CACHE INTERNAL "processor")
26set(CMAKE_LIBRARY_ARCHITECTURE powerpc-none-eabi CACHE INTERNAL "abi")
27
28find_program(CMAKE_AR ${cross_prefix}gcc-ar${extension})
29find_program(CMAKE_RANLIB ${cross_prefix}gcc-ranlib${extension})
30find_program(CMAKE_C_COMPILER ${cross_prefix}gcc${extension})
31find_program(CMAKE_CXX_COMPILER ${cross_prefix}g++${extension})
32find_program(CMAKE_ASM_COMPILER ${cross_prefix}gcc${extension})
33find_program(CMAKE_LINKER ${cross_prefix}ld${extension})
34set(CMAKE_C_FLAGS ${inc_flags} CACHE INTERNAL "c compiler flags")
35set(CMAKE_ASM_FLAGS ${inc_flags} CACHE INTERNAL "assembler flags")
36set(CMAKE_CXX_FLAGS ${inc_flags} CACHE INTERNAL "cxx compiler flags")
37
38set(CMAKE_EXE_LINKER_FLAGS ${link_flags} CACHE INTERNAL "exe link flags")
39set(CMAKE_MODULE_LINKER_FLAGS ${link_flags} CACHE INTERNAL "module link flags")
40set(CMAKE_SHARED_LINKER_FLAGS ${link_flags} CACHE INTERNAL "shared link flags")
41
42set(CMAKE_FIND_ROOT_PATH ${DEVKITPPC}/powerpc-eabi ${DEVKITPRO}/portlibs/ppc)
43set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER CACHE INTERNAL "")
44set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY CACHE INTERNAL "")
45set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY CACHE INTERNAL "")
46set(PKG_CONFIG_EXECUTABLE "/dev/null" CACHE INTERNAL "" FORCE)
47
48set(WII ON)
49add_definitions(-DGEKKO)