all repos — mgba @ 8aee10486211a8b549dcc2a9d42a4174b2ded1a0

mGBA Game Boy Advance Emulator

src/platform/psp2/CMakeToolchain.vitasdk (view raw)

 1if(DEFINED ENV{VITASDK})
 2	set(VITASDK $ENV{VITASDK})
 3else()
 4	message(FATAL_ERROR "Could not find VITASDK in environment")
 5endif()
 6
 7set(extension)
 8if (CMAKE_HOST_WIN32)
 9	set(extension .exe)
10endif()
11
12set(toolchain_dir ${VITASDK})
13set(CMAKE_PROGRAM_PATH ${toolchain_dir}/bin)
14
15set(cross_prefix ${CMAKE_PROGRAM_PATH}/arm-vita-eabi-)
16set(inc_flags -I${toolchain_dir}/include)
17set(link_flags "-L${toolchain_dir}/lib -Wl,-q")
18
19set(CMAKE_SYSTEM_NAME Generic CACHE INTERNAL "system name")
20set(CMAKE_SYSTEM_PROCESSOR armv7-a CACHE INTERNAL "processor")
21set(CMAKE_LIBRARY_ARCHITECTURE arm-vita-eabi CACHE INTERNAL "abi")
22
23set(CMAKE_AR ${cross_prefix}gcc-ar${extension} CACHE INTERNAL "archiver")
24set(CMAKE_RANLIB ${cross_prefix}gcc-ranlib${extension} CACHE INTERNAL "archiver")
25set(CMAKE_C_COMPILER ${cross_prefix}gcc${extension} CACHE INTERNAL "c compiler")
26set(CMAKE_CXX_COMPILER ${cross_prefix}g++${extension} CACHE INTERNAL "cxx compiler")
27set(CMAKE_ASM_COMPILER ${cross_prefix}gcc${extension} CACHE INTERNAL "assembler")
28set(CMAKE_C_FLAGS ${inc_flags} CACHE INTERNAL "c compiler flags")
29set(CMAKE_ASM_FLAGS ${inc_flags} CACHE INTERNAL "c compiler flags")
30set(CMAKE_CXX_FLAGS ${inc_flags} CACHE INTERNAL "cxx compiler flags")
31set(CMAKE_LINKER ${cross_prefix}ld CACHE INTERNAL "linker")
32
33set(CMAKE_EXE_LINKER_FLAGS ${link_flags} CACHE INTERNAL "exe link flags")
34set(CMAKE_MODULE_LINKER_FLAGS ${link_flags} CACHE INTERNAL "module link flags")
35set(CMAKE_SHARED_LINKER_FLAGS ${link_flags} CACHE INTERNAL "shared link flags")
36
37set(CMAKE_FIND_ROOT_PATH ${VITASDK}/arm-vita-eabi;${VITASDK})
38set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER CACHE INTERNAL "")
39set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY CACHE INTERNAL "")
40set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY CACHE INTERNAL "")
41set(ENV{PKG_CONFIG_PATH} ${VITASDK}/arm-vita-eabi/lib/pkgconfig)
42set(ENV{PKG_CONFIG_LIBDIR} ${VITASDK}/arm-vita-eabi/lib/pkgconfig)
43
44set(PSP2 ON)
45add_definitions(-DPSP2)
46set(M_LIBRARY m)