all repos — mgba @ c14da05d8dca225010677643c32fea5c0ac8517a

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(toolchain_dir ${VITASDK})
 8set(toolchain_bin_dir ${toolchain_dir}/bin)
 9set(cross_prefix ${toolchain_bin_dir}/arm-vita-eabi-)
10set(inc_flags -I${toolchain_dir}/include)
11set(link_flags "-L${toolchain_dir}/lib -Wl,-q")
12
13set(CMAKE_SYSTEM_NAME Generic CACHE INTERNAL "system name")
14set(CMAKE_SYSTEM_PROCESSOR armv7-a CACHE INTERNAL "processor")
15set(CMAKE_LIBRARY_ARCHITECTURE arm-vita-eabi CACHE INTERNAL "abi")
16set(CMAKE_AR ${cross_prefix}gcc-ar CACHE INTERNAL "archiver")
17set(CMAKE_RANLIB ${cross_prefix}gcc-ranlib CACHE INTERNAL "ranlib")
18set(CMAKE_C_COMPILER ${cross_prefix}gcc CACHE INTERNAL "c compiler")
19set(CMAKE_CXX_COMPILER ${cross_prefix}g++ CACHE INTERNAL "cxx compiler")
20set(CMAKE_ASM_COMPILER ${cross_prefix}gcc CACHE INTERNAL "assembler")
21set(common_flags "${inc_flags}")
22set(CMAKE_C_FLAGS ${common_flags} CACHE INTERNAL "c compiler flags")
23set(CMAKE_ASM_FLAGS ${common_flags} CACHE INTERNAL "c compiler flags")
24set(CMAKE_CXX_FLAGS ${common_flags} CACHE INTERNAL "cxx compiler flags")
25set(CMAKE_LINKER ${cross_prefix}ld CACHE INTERNAL "linker")
26
27set(CMAKE_EXE_LINKER_FLAGS ${link_flags} CACHE INTERNAL "exe link flags")
28set(CMAKE_MODULE_LINKER_FLAGS ${link_flags} CACHE INTERNAL "module link flags")
29set(CMAKE_SHARED_LINKER_FLAGS ${link_flags} CACHE INTERNAL "shared link flags")
30
31set(PKG_CONFIG_EXECUTABLE "/dev/null" CACHE INTERNAL "" FORCE)
32
33set(FIXUP ${toolchain_bin_dir}/vita-elf-create)
34set(OBJCOPY ${cross_prefix}objcopy)
35set(NIDDB ${VITASDK}/db.json)
36
37set(PSP2 ON)
38add_definitions(-DPSP2)
39set(M_LIBRARY m)