mirror of https://github.com/mgba-emu/mgba.git
PSP2: Update toolchain to use vita.cmake
This commit is contained in:
parent
63d475c350
commit
8f049e0183
1
CHANGES
1
CHANGES
|
@ -170,6 +170,7 @@ Misc:
|
||||||
- Qt: Add language selector
|
- Qt: Add language selector
|
||||||
- GBA Timer: Improve accuracy of timers
|
- GBA Timer: Improve accuracy of timers
|
||||||
- Qt: Minor test fixes
|
- Qt: Minor test fixes
|
||||||
|
- PSP2: Update toolchain to use vita.cmake
|
||||||
|
|
||||||
0.6 beta 1: (2017-06-29)
|
0.6 beta 1: (2017-06-29)
|
||||||
- Initial beta for 0.6
|
- Initial beta for 0.6
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
find_program(FIXUP vita-elf-create)
|
include("${VITASDK}/share/vita.cmake" REQUIRED)
|
||||||
find_program(MAKE_FSELF vita-make-fself)
|
|
||||||
find_program(MAKE_SFO vita-mksfoex)
|
|
||||||
find_program(OBJCOPY ${cross_prefix}objcopy)
|
find_program(OBJCOPY ${cross_prefix}objcopy)
|
||||||
find_file(NIDDB db.json PATHS ${VITASDK} ${VITASDK}/bin ${VITASDK}/share)
|
find_file(NIDDB db.json PATHS ${VITASDK} ${VITASDK}/bin ${VITASDK}/share)
|
||||||
find_program(STRIP ${cross_prefix}strip)
|
|
||||||
|
|
||||||
set(OS_DEFINES IOAPI_NO_64)
|
set(OS_DEFINES IOAPI_NO_64)
|
||||||
set(OS_DEFINES ${OS_DEFINES} PARENT_SCOPE)
|
set(OS_DEFINES ${OS_DEFINES} PARENT_SCOPE)
|
||||||
|
@ -37,34 +35,16 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/backdrop.o
|
||||||
COMMAND ${OBJCOPY_CMD} backdrop.png ${CMAKE_CURRENT_BINARY_DIR}/backdrop.o
|
COMMAND ${OBJCOPY_CMD} backdrop.png ${CMAKE_CURRENT_BINARY_DIR}/backdrop.o
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
add_custom_target(${BINARY_NAME}.velf ALL
|
vita_create_self(${BINARY_NAME}.self ${BINARY_NAME}.elf)
|
||||||
${STRIP} --strip-unneeded -go ${BINARY_NAME}-stripped.elf ${BINARY_NAME}.elf
|
|
||||||
COMMAND ${FIXUP} ${BINARY_NAME}-stripped.elf ${BINARY_NAME}.velf ${NIDDB}
|
|
||||||
DEPENDS ${BINARY_NAME}.elf)
|
|
||||||
|
|
||||||
add_custom_target(sce_sys ${CMAKE_COMMAND} -E make_directory sce_sys)
|
|
||||||
|
|
||||||
add_custom_target(param.sfo
|
|
||||||
${MAKE_SFO} ${PROJECT_NAME} -s TITLE_ID=MGBA00001 sce_sys/param.sfo
|
|
||||||
DEPENDS sce_sys)
|
|
||||||
|
|
||||||
add_custom_target(eboot.bin
|
|
||||||
${MAKE_FSELF} -s ${BINARY_NAME}.velf eboot.bin
|
|
||||||
DEPENDS ${BINARY_NAME}.velf)
|
|
||||||
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/template.xml.in ${CMAKE_CURRENT_BINARY_DIR}/template.xml)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/template.xml.in ${CMAKE_CURRENT_BINARY_DIR}/template.xml)
|
||||||
|
|
||||||
add_custom_target(livearea
|
vita_create_vpk(${BINARY_NAME}.vpk MGBA00001 ${BINARY_NAME}.self
|
||||||
${CMAKE_COMMAND} -E make_directory sce_sys/livearea/contents
|
NAME ${PROJECT_NAME}
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/icon0.png sce_sys
|
FILE ${CMAKE_CURRENT_SOURCE_DIR}/icon0.png sce_sys/icon0.png
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/pic0.png sce_sys
|
FILE ${CMAKE_CURRENT_SOURCE_DIR}/pic0.png sce_sys/pic0.png
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/template.xml sce_sys/livearea/contents
|
FILE ${CMAKE_CURRENT_SOURCE_DIR}/bg.png sce_sys/livearea/contents/bg.png
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bg.png sce_sys/livearea/contents
|
FILE ${CMAKE_CURRENT_SOURCE_DIR}/startup.png sce_sys/livearea/contents/startup.png
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/startup.png sce_sys/livearea/contents
|
FILE ${CMAKE_CURRENT_BINARY_DIR}/template.xml sce_sys/livearea/contents/template.xml)
|
||||||
DEPENDS sce_sys)
|
|
||||||
|
|
||||||
add_custom_target(${BINARY_NAME}.vpk ALL
|
|
||||||
zip -qr ${BINARY_NAME}.vpk sce_sys eboot.bin
|
|
||||||
DEPENDS livearea eboot.bin param.sfo)
|
|
||||||
|
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${BINARY_NAME}.vpk DESTINATION . COMPONENT ${BINARY_NAME}-psp2)
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${BINARY_NAME}.vpk DESTINATION . COMPONENT ${BINARY_NAME}-psp2)
|
||||||
|
|
|
@ -14,7 +14,7 @@ set(CMAKE_PROGRAM_PATH ${toolchain_dir}/bin)
|
||||||
|
|
||||||
set(cross_prefix arm-vita-eabi-)
|
set(cross_prefix arm-vita-eabi-)
|
||||||
set(inc_flags -I${toolchain_dir}/include)
|
set(inc_flags -I${toolchain_dir}/include)
|
||||||
set(link_flags "-L${toolchain_dir}/lib -Wl,-q")
|
set(link_flags "-L${toolchain_dir}/lib -Wl,-z,nocopyreloc")
|
||||||
|
|
||||||
set(CMAKE_SYSTEM_NAME Generic CACHE INTERNAL "system name")
|
set(CMAKE_SYSTEM_NAME Generic CACHE INTERNAL "system name")
|
||||||
set(CMAKE_SYSTEM_PROCESSOR armv7-a CACHE INTERNAL "processor")
|
set(CMAKE_SYSTEM_PROCESSOR armv7-a CACHE INTERNAL "processor")
|
||||||
|
@ -26,9 +26,9 @@ find_program(CMAKE_C_COMPILER ${cross_prefix}gcc${extension})
|
||||||
find_program(CMAKE_CXX_COMPILER ${cross_prefix}g++${extension})
|
find_program(CMAKE_CXX_COMPILER ${cross_prefix}g++${extension})
|
||||||
find_program(CMAKE_ASM_COMPILER ${cross_prefix}gcc${extension})
|
find_program(CMAKE_ASM_COMPILER ${cross_prefix}gcc${extension})
|
||||||
find_program(CMAKE_LINKER ${cross_prefix}ld${extension})
|
find_program(CMAKE_LINKER ${cross_prefix}ld${extension})
|
||||||
set(CMAKE_C_FLAGS ${inc_flags} CACHE INTERNAL "c compiler flags")
|
set(CMAKE_C_FLAGS "${inc_flags} -Wl,-q" CACHE INTERNAL "c compiler flags")
|
||||||
set(CMAKE_ASM_FLAGS ${inc_flags} CACHE INTERNAL "assembler flags")
|
set(CMAKE_ASM_FLAGS ${inc_flags} CACHE INTERNAL "assembler flags")
|
||||||
set(CMAKE_CXX_FLAGS ${inc_flags} CACHE INTERNAL "cxx compiler flags")
|
set(CMAKE_CXX_FLAGS "${inc_flags} -Wl,-q" CACHE INTERNAL "cxx compiler flags")
|
||||||
|
|
||||||
set(CMAKE_EXE_LINKER_FLAGS ${link_flags} CACHE INTERNAL "exe link flags")
|
set(CMAKE_EXE_LINKER_FLAGS ${link_flags} CACHE INTERNAL "exe link flags")
|
||||||
set(CMAKE_MODULE_LINKER_FLAGS ${link_flags} CACHE INTERNAL "module link flags")
|
set(CMAKE_MODULE_LINKER_FLAGS ${link_flags} CACHE INTERNAL "module link flags")
|
||||||
|
@ -41,6 +41,13 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY CACHE INTERNAL "")
|
||||||
set(ENV{PKG_CONFIG_PATH} ${VITASDK}/arm-vita-eabi/lib/pkgconfig)
|
set(ENV{PKG_CONFIG_PATH} ${VITASDK}/arm-vita-eabi/lib/pkgconfig)
|
||||||
set(ENV{PKG_CONFIG_LIBDIR} ${VITASDK}/arm-vita-eabi/lib/pkgconfig)
|
set(ENV{PKG_CONFIG_LIBDIR} ${VITASDK}/arm-vita-eabi/lib/pkgconfig)
|
||||||
|
|
||||||
|
set(VITA_ELF_CREATE "${VITASDK}/bin/vita-elf-create${TOOL_OS_SUFFIX}" CACHE PATH "vita-elf-create")
|
||||||
|
set(VITA_ELF_EXPORT "${VITASDK}/bin/vita-elf-export${TOOL_OS_SUFFIX}" CACHE PATH "vita-elf-export")
|
||||||
|
set(VITA_LIBS_GEN "${VITASDK}/bin/vita-libs-gen${TOOL_OS_SUFFIX}" CACHE PATH "vita-libs-gen")
|
||||||
|
set(VITA_MAKE_FSELF "${VITASDK}/bin/vita-make-fself${TOOL_OS_SUFFIX}" CACHE PATH "vita-make-fself")
|
||||||
|
set(VITA_MKSFOEX "${VITASDK}/bin/vita-mksfoex${TOOL_OS_SUFFIX}" CACHE PATH "vita-mksfoex")
|
||||||
|
set(VITA_PACK_VPK "${VITASDK}/bin/vita-pack-vpk${TOOL_OS_SUFFIX}" CACHE PATH "vita-pack-vpk")
|
||||||
|
|
||||||
set(PSP2 ON)
|
set(PSP2 ON)
|
||||||
add_definitions(-DPSP2)
|
add_definitions(-DPSP2)
|
||||||
set(M_LIBRARY m)
|
set(M_LIBRARY m)
|
||||||
|
|
Loading…
Reference in New Issue