forked from TheOfficialFloW/gtasa_vita
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
107 lines (96 loc) · 2.64 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
cmake_minimum_required(VERSION 2.8)
if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
if(DEFINED ENV{VITASDK})
set(CMAKE_TOOLCHAIN_FILE "$ENV{VITASDK}/share/vita.toolchain.cmake" CACHE PATH "toolchain file")
else()
message(FATAL_ERROR "Please define VITASDK to point to your SDK path!")
endif()
endif()
project(GTASA C CXX)
include("${VITASDK}/share/vita.cmake" REQUIRED)
set(VITA_APP_NAME "GTA: SA")
set(VITA_TITLEID "GTASA0000")
set(VITA_VERSION "02.10")
set(VITA_MKSFOEX_FLAGS "-d ATTRIBUTE2=12")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wl,-q,--wrap,memcpy,--wrap,memmove,--wrap,memset -D_GNU_SOURCE -Wall -O3 -mfloat-abi=softfp")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -Wno-write-strings")
add_executable(GTASA
loader/main.c
loader/config.c
loader/dialog.c
loader/fios.c
loader/so_util.c
loader/jni_patch.c
loader/mpg123_patch.c
loader/openal_patch.c
loader/opengl_patch.c
loader/gfx_patch.c
loader/scripts_patch.c
loader/sha1.c
)
add_dependencies(GTASA companion.bin)
target_link_libraries(GTASA
-Wl,--whole-archive pthread -Wl,--no-whole-archive
m
stdc++
openal
vitaGL
vitashark
mathneon
mpg123
kubridge_stub
SceAppMgr_stub
SceAppUtil_stub
SceAudio_stub
SceAudioIn_stub
SceCtrl_stub
SceCommonDialog_stub
SceDisplay_stub
SceKernelDmacMgr_stub
SceFios2_stub
SceGxm_stub
SceLibcBridge_stub
SceShaccCg_stub
SceSysmodule_stub
ScePower_stub
SceTouch_stub
SceVshBridge_stub
)
add_executable(companion
companion/main.cpp
)
target_link_libraries(companion
imgui
vitaGL
vitashark
mathneon
SceAppMgr_stub
SceAudio_stub
SceCtrl_stub
SceCommonDialog_stub
SceDisplay_stub
SceKernelDmacMgr_stub
SceGxm_stub
SceShaccCg_stub
SceSysmodule_stub
SceTouch_stub
SceVshBridge_stub
)
vita_create_self(companion.bin companion UNSAFE)
vita_create_self(eboot.bin GTASA UNSAFE)
vita_create_vpk(GTASA.vpk ${VITA_TITLEID} eboot.bin
VERSION ${VITA_VERSION}
NAME ${VITA_APP_NAME}
FILE ${CMAKE_SOURCE_DIR}/sce_sys/icon0.png sce_sys/icon0.png
${CMAKE_SOURCE_DIR}/sce_sys/livearea/contents/bg.png sce_sys/livearea/contents/bg.png
${CMAKE_SOURCE_DIR}/sce_sys/livearea/contents/config.png sce_sys/livearea/contents/config.png
${CMAKE_SOURCE_DIR}/sce_sys/livearea/contents/startup.png sce_sys/livearea/contents/startup.png
${CMAKE_SOURCE_DIR}/sce_sys/livearea/contents/template.xml sce_sys/livearea/contents/template.xml
${CMAKE_BINARY_DIR}/companion.bin companion.bin
)
add_custom_target(copy
COMMAND cp eboot.bin E:/app/${VITA_TITLEID}/eboot.bin
COMMAND cp companion.bin E:/app/${VITA_TITLEID}/companion.bin
DEPENDS eboot.bin
DEPENDS companion.bin
)