VitaShell/CMakeLists.txt

201 lines
4.1 KiB
CMake
Raw 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")
2018-01-27 22:21:46 +00:00
set(VITA_VERSION "01.81")
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
include_directories(
)
2016-12-09 07:18:12 +00:00
link_directories(
${CMAKE_CURRENT_BINARY_DIR}
)
# Builds
FUNCTION(ADD_RESOURCES out_var)
SET(result)
FOREACH(in_f ${ARGN})
2017-10-13 10:42:36 +00:00
SET(out_f "${CMAKE_CURRENT_BINARY_DIR}/${in_f}.o")
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 ${in_f}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
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/default/*.png
resources/default/*.txt
resources/electron/*.png
resources/electron/*.txt
resources/*.png
resources/*.txt
resources/*.bin
resources/*.suprx
resources/*.skprx
)
2016-12-09 07:18:12 +00:00
add_resources(vitashell_res ${res_files})
add_executable(VitaShell
${vitashell_res}
main.c
2017-02-13 20:07:09 +00:00
main_context.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
)
target_link_libraries(VitaShell
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
VitaShellUser_stub_weak
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
2017-10-13 10:42:36 +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
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-01-27 14:28:51 +00:00
COMMAND cp eboot.bin F:/app/${VITA_TITLEID}/eboot.bin
2017-02-13 10:06:23 +00:00
DEPENDS eboot.bin
)