/
CMakeLists.txt
162 lines (150 loc) · 3.3 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
add_library(common
Analytics.cpp
CDUtils.cpp
ColorUtil.cpp
CommonFuncs.cpp
Config/Config.cpp
Config/ConfigInfo.cpp
Config/Layer.cpp
Crypto/AES.cpp
Crypto/bn.cpp
Crypto/ec.cpp
ENetUtil.cpp
File.cpp
FileSearch.cpp
FileUtil.cpp
GekkoDisassembler.cpp
Hash.cpp
HttpRequest.cpp
IniFile.cpp
JitRegister.cpp
Logging/LogManager.cpp
MathUtil.cpp
MD5.cpp
MemArena.cpp
MemoryUtil.cpp
MsgHandler.cpp
NandPaths.cpp
Network.cpp
PcapFile.cpp
PerformanceCounter.cpp
Profiler.cpp
QoSSession.cpp
SDCardUtil.cpp
SettingsHandler.cpp
StringUtil.cpp
SymbolDB.cpp
Thread.cpp
Timer.cpp
TraversalClient.cpp
UPnP.cpp
Version.cpp
x64ABI.cpp
x64Emitter.cpp
)
target_link_libraries(common
PUBLIC
${CMAKE_THREAD_LIBS_INIT}
enet
${MBEDTLS_LIBRARIES}
PRIVATE
${CURL_LIBRARIES}
${ICONV_LIBRARIES}
${VTUNE_LIBRARIES}
)
if (APPLE)
target_link_libraries(common
PRIVATE
${APPKIT_LIBRARY}
${COREFOUNDATION_LIBRARY}
${IOK_LIBRARY}
)
endif()
if(ANDROID)
target_sources(common PRIVATE
Logging/ConsoleListenerDroid.cpp
)
elseif(WIN32)
target_sources(common PRIVATE
Logging/ConsoleListenerWin.cpp
)
else()
target_sources(common PRIVATE
Logging/ConsoleListenerNix.cpp
)
endif()
if(_M_ARM_64)
target_sources(common PRIVATE
Arm64Emitter.cpp
ArmCPUDetect.cpp
GenericFPURoundMode.cpp
)
else()
if(_M_X86) #X86
target_sources(common PRIVATE
x64FPURoundMode.cpp
x64CPUDetect.cpp
)
else() # Generic
target_sources(common PRIVATE
GenericFPURoundMode.cpp
GenericCPUDetect.cpp
)
endif()
endif()
# OpenGL Interface
target_sources(common PRIVATE
GL/GLUtil.cpp
GL/GLExtensions/GLExtensions.cpp
GL/GLInterface/GLInterface.cpp
)
if(USE_EGL)
target_sources(common PRIVATE GL/GLInterface/EGL.cpp)
if(ANDROID)
target_sources(common PRIVATE GL/GLInterface/EGLAndroid.cpp)
elseif(USE_X11)
target_sources(common PRIVATE GL/GLInterface/EGLX11.cpp)
endif()
target_link_libraries(common PUBLIC EGL)
endif()
if(WIN32)
target_sources(common PRIVATE
CompatPatches.cpp
GL/GLInterface/WGL.cpp
)
elseif(APPLE)
target_sources(common PRIVATE GL/GLInterface/AGL.mm)
elseif(HAIKU)
target_sources(common PRIVATE GL/GLInterface/BGL.cpp)
target_link_libraries(common PUBLIC be GL)
elseif(USE_X11)
if (NOT USE_EGL)
target_sources(common PRIVATE GL/GLInterface/GLX.cpp)
# GLX has a hard dependency on libGL.
# Make sure to link to it if using GLX.
target_link_libraries(common PUBLIC ${OPENGL_LIBRARIES})
endif()
target_sources(common PRIVATE GL/GLInterface/X11_Util.cpp)
target_link_libraries(common PUBLIC ${XRANDR_LIBRARIES})
endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
target_link_libraries(common PUBLIC dl rt)
endif()
if(USE_UPNP)
target_link_libraries(common PRIVATE Miniupnpc::miniupnpc)
endif()
if(OPROFILE_FOUND)
target_link_libraries(common PRIVATE OProfile::OProfile)
endif()
if(UNIX)
# Posix networking code needs to be fixed for Windows
add_executable(traversal_server TraversalServer.cpp)
if(SYSTEMD_FOUND)
target_link_libraries(traversal_server ${SYSTEMD_LIBRARIES})
endif()
if(HAIKU)
target_link_libraries(traversal_server network)
endif()
elseif(WIN32)
target_link_libraries(common PRIVATE "-INCLUDE:enableCompatPatches")
endif()