all repos — mgba @ 4cf016d442f966605d818f9fee26b375dcebac35

mGBA Game Boy Advance Emulator

src/platform/psp2/CMakeLists.txt (view raw)

 1file(GLOB OS_SRC ${CMAKE_SOURCE_DIR}/src/platform/psp2/psp2-*.c)
 2set(OS_SRC ${OS_SRC} PARENT_SCOPE)
 3source_group("PS Vita-specific code" FILES ${OS_SRC})
 4
 5list(APPEND VFS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/sce-vfs.c)
 6set(VFS_SRC ${VFS_SRC} PARENT_SCOPE)
 7
 8set(OS_LIB -lvita2d -lSceCtrl_stub -lSceRtc_stub -lSceGxm_stub -lSceDisplay_stub -lSceAudio_stub -lSceMotion_stub -lScePower_stub -lSceTouch_stub -lpng -lz -l${M_LIBRARY})
 9set(OBJCOPY_CMD ${OBJCOPY} -I binary -O elf32-littlearm -B arm)
10
11list(APPEND GUI_SRC ${CMAKE_CURRENT_SOURCE_DIR}/gui-font.c)
12
13set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/font.c ${CMAKE_CURRENT_BINARY_DIR}/backdrop.c PROPERTIES GENERATED ON)
14add_executable(${BINARY_NAME}.elf ${PLATFORM_SRC} ${GUI_SRC} ${CMAKE_BINARY_DIR}/font.o ${CMAKE_BINARY_DIR}/backdrop.o main.c)
15set_target_properties(${BINARY_NAME}.elf PROPERTIES COMPILE_DEFINITIONS "${OS_DEFINES}")
16target_link_libraries(${BINARY_NAME}.elf ${BINARY_NAME} ${OS_LIB})
17
18add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/font.c
19                   COMMAND ${OBJCOPY_CMD} font.png ${CMAKE_CURRENT_BINARY_DIR}/font.o
20                   WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/res)
21
22add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/backdrop.c
23                   COMMAND ${OBJCOPY_CMD} backdrop.png ${CMAKE_CURRENT_BINARY_DIR}/backdrop.o
24                   WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/res)
25
26add_custom_target(${BINARY_NAME}.velf ALL
27                  ${FIXUP} ${BINARY_NAME}.elf ${BINARY_NAME}.velf ${NIDDB}
28                  DEPENDS ${BINARY_NAME}.elf)
29
30install(FILES ${BINARY_NAME}.velf DESTINATION . COMPONENT ${BINARY_NAME}-psp2)