VitaShell/CMakeLists.txt

242 lines
5.4 KiB
CMake
Raw Permalink Normal View History

2016-12-09 07:18:12 +00:00
cmake_minimum_required(VERSION 2.8)
# VitaSDK defines
if( NOT DEFINED CMAKE_TOOLCHAIN_FILE )
if( DEFINED ENV{VITASDK} )
2017-10-13 10:42:36 +00:00
set(CMAKE_TOOLCHAIN_FILE "$ENV{VITASDK}/share/vita.toolchain.cmake" CACHE PATH "toolchain file")
2016-12-09 07:18:12 +00:00
else()
2017-10-13 10:42:36 +00:00
message(FATAL_ERROR "Please define VITASDK to point to your SDK path!")
2016-12-09 07:18:12 +00:00
endif()
endif()
# Project start
project(VitaShell)
include("${VITASDK}/share/vita.cmake" REQUIRED)
set(VITA_APP_NAME "VitaShell")
set(VITA_TITLEID "VITASHELL")
2020-01-18 23:07:43 +00:00
set(VITA_VERSION "02.02")
2016-12-09 07:18:12 +00:00
# Flags and includes
2017-09-15 20:10:42 +00:00
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O3 -Wno-unused-variable -Wno-unused-but-set-variable -Wno-format-truncation -fno-lto")
2017-10-13 10:42:36 +00:00
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c+ + 11 -fno-rtti -fno-exceptions")
2016-12-09 07:18:12 +00:00
set(VITA_MKSFOEX_FLAGS "${VITA_MKSFOEX_FLAGS} -d PARENTAL_LEVEL=1")
2017-09-17 14:30:49 +00:00
set(VITA_MAKE_FSELF_FLAGS "${VITA_MAKE_FSELF_FLAGS} -a 0x2808000000000000")
2016-12-09 07:18:12 +00:00
add_subdirectory(modules/kernel)
add_subdirectory(modules/user)
add_subdirectory(modules/patch)
add_subdirectory(modules/usbdevice)
include_directories(
modules/kernel
modules/user
)
2016-12-09 07:18:12 +00:00
link_directories(
${CMAKE_CURRENT_BINARY_DIR}
)
# Builds
FUNCTION(ADD_RESOURCES out_var)
SET(result)
FOREACH(ref_f ${ARGN})
if (IS_ABSOLUTE "${ref_f}")
SET(out_f "${ref_f}.o")
STRING(REPLACE "${CMAKE_CURRENT_BINARY_DIR}/" "" in_f "${ref_f}")
SET(work_dir "${CMAKE_CURRENT_BINARY_DIR}")
else()
SET(out_f "${CMAKE_CURRENT_BINARY_DIR}/${ref_f}.o")
SET(in_f "${ref_f}")
SET(work_dir "${CMAKE_SOURCE_DIR}")
endif()
2017-10-13 10:42:36 +00:00
GET_FILENAME_COMPONENT(out_dir ${out_f} DIRECTORY)
ADD_CUSTOM_COMMAND(OUTPUT ${out_f}
COMMAND ${CMAKE_COMMAND} -E make_directory ${out_dir}
COMMAND ${CMAKE_LINKER} -r -b binary -o ${out_f} ${in_f}
DEPENDS ${ref_f}
WORKING_DIRECTORY ${work_dir}
2017-10-13 10:42:36 +00:00
COMMENT "Building resource ${out_f}"
VERBATIM
)
LIST(APPEND result ${out_f})
2016-12-09 07:18:12 +00:00
ENDFOREACH()
SET(${out_var} "${result}" PARENT_SCOPE)
ENDFUNCTION()
2017-03-17 21:48:36 +00:00
file(GLOB res_files RELATIVE
${CMAKE_SOURCE_DIR}
resources/umass.skprx
2017-03-17 21:48:36 +00:00
resources/default/*.png
resources/default/*.txt
resources/electron/*.png
resources/electron/*.txt
resources/*.png
resources/*.txt
resources/*.bin
)
# ugly hack
2018-08-27 15:16:07 +00:00
add_resources(vitashell_res
${res_files}
${CMAKE_CURRENT_BINARY_DIR}/modules/kernel/kernel.skprx
${CMAKE_CURRENT_BINARY_DIR}/modules/user/user.suprx
${CMAKE_CURRENT_BINARY_DIR}/modules/patch/patch.skprx
${CMAKE_CURRENT_BINARY_DIR}/modules/usbdevice/usbdevice.skprx
2018-08-27 15:16:07 +00:00
)
2016-12-09 07:18:12 +00:00
add_executable(VitaShell
${vitashell_res}
main.c
pfs.c
2017-02-13 20:07:09 +00:00
main_context.c
browser.c
2016-12-09 07:18:12 +00:00
init.c
2017-02-13 10:06:23 +00:00
usb.c
qr.c
2016-12-09 07:18:12 +00:00
io_process.c
makezip.c
package_installer.c
2017-02-27 20:53:38 +00:00
refresh.c
2016-12-09 07:18:12 +00:00
network_update.c
network_download.c
2016-12-09 07:18:12 +00:00
context_menu.c
archive.c
2018-01-25 15:48:51 +00:00
psarc.c
2016-12-09 07:18:12 +00:00
photo.c
audioplayer.c
file.c
text.c
hex.c
sfo.c
rif.c
sqlite3.c
2017-01-04 19:08:04 +00:00
coredump.c
2016-12-09 07:18:12 +00:00
settings.c
2018-01-26 10:36:14 +00:00
adhoc_dialog.c
2016-12-09 07:18:12 +00:00
property_dialog.c
uncommon_dialog.c
message_dialog.c
2018-01-26 10:36:14 +00:00
netcheck_dialog.c
2016-12-09 07:18:12 +00:00
ime_dialog.c
config.c
theme.c
language.c
utils.c
elf.c
sha1.c
minizip/zip.c
minizip/ioapi.c
bm.c
2018-01-25 10:11:08 +00:00
strnatcmp.c
2016-12-09 07:18:12 +00:00
audio/vita_audio.c
audio/player.c
audio/id3.c
audio/oggplayer.c
audio/mp3player.c
audio/mp3xing.c
audio/lrcparse.c
libmad/bit.c
libmad/decoder.c
libmad/fixed.c
libmad/frame.c
libmad/huffman.c
libmad/layer12.c
libmad/layer3.c
libmad/stream.c
libmad/synth.c
libmad/timer.c
)
add_dependencies(VitaShell vitashell_user_stubs)
2018-08-27 15:16:07 +00:00
add_dependencies(VitaShell kernel.skprx)
add_dependencies(VitaShell user.suprx)
add_dependencies(VitaShell patch.skprx)
add_dependencies(VitaShell usbdevice.skprx)
2016-12-09 07:18:12 +00:00
target_link_libraries(VitaShell
${CMAKE_CURRENT_BINARY_DIR}/modules/user/libVitaShellUser_stub_weak.a
2016-12-11 21:30:07 +00:00
ftpvita
vita2d
2016-12-09 07:18:12 +00:00
vorbisfile
vorbis
ogg
png
jpeg
z
m
c
quirc
2016-12-11 21:30:07 +00:00
onigmo
2017-12-30 19:35:25 +00:00
archive
bz2
2017-12-31 00:47:19 +00:00
lzma
crypto
expat
2016-12-11 21:30:07 +00:00
taihen_stub
2016-12-09 07:18:12 +00:00
SceAppMgr_stub
SceAppUtil_stub
SceAudio_stub
SceAudiodec_stub
SceCamera_stub
2016-12-09 07:18:12 +00:00
SceCommonDialog_stub
SceCtrl_stub
SceDisplay_stub
2018-01-25 15:48:51 +00:00
SceFios2_stub
2016-12-09 07:18:12 +00:00
SceGxm_stub
SceIme_stub
SceHttp_stub
SceLibKernel_stub
2017-01-12 16:45:52 +00:00
SceMtpIfDriver_stub
2016-12-09 07:18:12 +00:00
SceMusicExport_stub
SceNet_stub
SceNetCtl_stub
2017-03-05 14:27:16 +00:00
SceNpDrm_stub
2017-03-18 03:15:53 +00:00
SceRegistryMgr_stub
2016-12-09 07:18:12 +00:00
SceShellSvc_stub
SceSqlite_stub
2016-12-09 07:18:12 +00:00
SceSsl_stub
SceSysmodule_stub
2016-12-11 21:30:07 +00:00
ScePgf_stub
2016-12-09 07:18:12 +00:00
ScePhotoExport_stub
ScePower_stub
2018-01-26 10:36:14 +00:00
ScePspnetAdhoc_stub
2016-12-09 07:18:12 +00:00
ScePromoterUtil_stub
2016-12-11 21:30:07 +00:00
SceTouch_stub
2017-01-12 16:45:52 +00:00
SceUdcd_stub
SceUsbstorVStorDriver_stub
2017-06-22 22:09:31 +00:00
SceVideoExport_stub
2017-01-12 16:45:52 +00:00
SceVshBridge_stub
2016-12-09 07:18:12 +00:00
)
# Create Vita artifacts
2017-01-12 16:45:52 +00:00
vita_create_self(eboot.bin VitaShell UNSAFE)
vita_create_vpk(VitaShell.vpk ${VITA_TITLEID} eboot.bin
2016-12-09 07:18:12 +00:00
VERSION ${VITA_VERSION}
NAME ${VITA_APP_NAME}
FILE pkg/sce_sys/icon0.png sce_sys/icon0.png
2018-08-27 15:16:07 +00:00
pkg/sce_sys/livearea/contents/bg.png sce_sys/livearea/contents/bg.png
pkg/sce_sys/livearea/contents/startup.png sce_sys/livearea/contents/startup.png
pkg/sce_sys/livearea/contents/template.xml sce_sys/livearea/contents/template.xml
2016-12-09 07:18:12 +00:00
)
2017-01-12 16:45:52 +00:00
# for network update
2018-03-14 15:24:01 +00:00
add_custom_target(release
2018-06-17 14:31:54 +00:00
COMMAND cp eboot.bin ../release/eboot.bin
2018-06-17 15:05:28 +00:00
COMMAND cp VitaShell.vpk_param.sfo ../release/param.sfo
2018-03-14 15:24:01 +00:00
COMMAND cp VitaShell.vpk ../release/VitaShell.vpk
2018-06-17 17:39:58 +00:00
COMMAND cp ../pkg/sce_sys/livearea/contents/template.xml ../release/template.xml
2018-06-17 14:31:54 +00:00
DEPENDS eboot.bin
2018-06-17 15:05:28 +00:00
DEPENDS VitaShell.vpk
DEPENDS VitaShell.vpk_param.sfo
2018-03-14 15:24:01 +00:00
)
2017-01-12 16:45:52 +00:00
add_custom_target(send
2017-02-13 10:06:23 +00:00
COMMAND curl -T eboot.bin ftp://$(PSVITAIP):1337/ux0:/app/${VITA_TITLEID}/
DEPENDS eboot.bin
2017-01-12 16:45:52 +00:00
)
add_custom_target(copy
2018-08-27 08:33:07 +00:00
COMMAND cp eboot.bin G:/app/${VITA_TITLEID}/eboot.bin
2017-02-13 10:06:23 +00:00
DEPENDS eboot.bin
)