forked from krkrz/krkrz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
291 lines (270 loc) · 7.55 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
cmake_minimum_required(VERSION 3.10.2)
if( ANDROID )
set(CMAKE_CXX_FLAGS_DEBUG "-g3 -O0")
set(CMAKE_C_FLAGS_DEBUG "-g3 -O0")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -s -DNDEBUG")
set(CMAKE_C_FLAGS_RELEASE "-O2 -s -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g3 -Og")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g3 -Og")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -s -DNDEBUG")
set(CMAKE_C_FLAGS_MINSIZEREL "-Os -s -DNDEBUG")
endif()
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUNICODE -DTJS_TEXT_OUT_CRLF -DTJS_JP_LOCALIZED -DTVP_ENABLE_EXECUTE_AT_EXCEPTION -DTVP_LOG_TO_COMMANDLINE_CONSOLE" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUNICODE -DTJS_TEXT_OUT_CRLF -DTJS_JP_LOCALIZED -DTVP_ENABLE_EXECUTE_AT_EXCEPTION -DTVP_LOG_TO_COMMANDLINE_CONSOLE" )
# 共通の include ディレクトリ
set( KRKRZ_INC
environ/
tjs2
external/onig/src
external/lpng
external/freetype/include
external/libjpeg-turbo
external/libjpeg-turbo/android
external/libogg/include
external/opus/include
external/opusfile/include
external/glm/
base
extension
sound
movie
msg
utils
visual
visual/gl
visual/opengl )
# Android 用の include ディレクトリ
if( ANDROID )
list(APPEND KRKRZ_INC
environ/android
base/android
sound/android
msg/android
utils/android
visual/android
)
elseif( WIN32 )
list(APPEND KRKRZ_INC
environ/win32
base/win32
sound/win32
msg/win32
utils/win32
visual/win32
)
endif()
include_directories( ${KRKRZ_INC} )
set( KRKRZ_SRC
tjs2/tjs.cpp
tjs2/tjs.tab.cpp
tjs2/tjsArray.cpp
tjs2/tjsBinarySerializer.cpp
tjs2/tjsByteCodeLoader.cpp
tjs2/tjsCompileControl.cpp
tjs2/tjsConfig.cpp
tjs2/tjsConstArrayData.cpp
tjs2/tjsDate.cpp
tjs2/tjsdate.tab.cpp
tjs2/tjsDateParser.cpp
tjs2/tjsDebug.cpp
tjs2/tjsDictionary.cpp
tjs2/tjsDisassemble.cpp
tjs2/tjsError.cpp
tjs2/tjsException.cpp
tjs2/tjsGlobalStringMap.cpp
tjs2/tjsInterCodeExec.cpp
tjs2/tjsInterCodeGen.cpp
tjs2/tjsInterface.cpp
tjs2/tjsLex.cpp
tjs2/tjsMath.cpp
tjs2/tjsMessage.cpp
tjs2/tjsMT19937ar-cok.cpp
tjs2/tjsNamespace.cpp
tjs2/tjsNative.cpp
tjs2/tjsObject.cpp
tjs2/tjsObjectExtendable.cpp
tjs2/tjsOctPack.cpp
tjs2/tjspp.tab.cpp
tjs2/tjsRandomGenerator.cpp
tjs2/tjsRegExp.cpp
tjs2/tjsScriptBlock.cpp
tjs2/tjsScriptCache.cpp
tjs2/tjsSnprintf.cpp
tjs2/tjsString.cpp
tjs2/tjsUtils.cpp
tjs2/tjsVariant.cpp
tjs2/tjsVariantString.cpp
base/BinaryStream.cpp
base/CharacterSet.cpp
base/EventIntf.cpp
base/PluginIntf.cpp
base/ScriptMgnIntf.cpp
base/StorageIntf.cpp
base/SysInitIntf.cpp
base/SystemIntf.cpp
base/TextStream.cpp
base/UtilStreams.cpp
base/XP3Archive.cpp
base/android/AssetMedia.cpp
base/android/ContentMedia.cpp
base/android/EventImpl.cpp
base/android/FuncStubs.cpp
base/android/SystemImpl.cpp
base/android/NativeEventQueue.cpp
base/android/PluginImpl.cpp
base/android/ScriptMgnImpl.cpp
base/android/StorageImpl.cpp
base/android/SysInitImpl.cpp
environ/TouchPoint.cpp
environ/android/Application.cpp
environ/android/DetectCPU.cpp
environ/android/TVPScreen.cpp
environ/android/SystemControl.cpp
environ/android/VirtualKey.cpp
environ/android/WindowForm.cpp
extension/Extension.cpp
msg/MsgIntf.cpp
msg/android/MsgImpl.cpp
msg/android/MsgLoad.cpp
sound/MathAlgorithms.cpp
sound/PhaseVocoderDSP.cpp
sound/PhaseVocoderFilter.cpp
sound/QueueSoundBufferImpl.cpp
sound/RealFFT.cpp
sound/SoundBufferBaseIntf.cpp
sound/SoundBufferBaseImpl.cpp
sound/SoundDecodeThread.cpp
sound/SoundEventThread.cpp
sound/SoundPlayer.cpp
sound/WaveFormatConverter.cpp
sound/WaveIntf.cpp
sound/WaveLoopManager.cpp
sound/WaveSegmentQueue.cpp
sound/OpusCodecDecoder.cpp
sound/android/OpenSLESAudioDevice.cpp
utils/ClipboardIntf.cpp
utils/cp932_uni.cpp
utils/DebugIntf.cpp
utils/md5.c
utils/MiscUtility.cpp
utils/Random.cpp
utils/ThreadIntf.cpp
utils/TickCount.cpp
utils/TimerThread.cpp
utils/TimerIntf.cpp
utils/TVPTimer.cpp
utils/uni_cp932.cpp
utils/VelocityTracker.cpp
utils/android/ClipboardImpl.cpp
visual/BitmapIntf.cpp
visual/BitmapLayerTreeOwner.cpp
visual/CharacterData.cpp
visual/ComplexRect.cpp
visual/DrawDevice.cpp
visual/FontSystem.cpp
visual/FreeType.cpp
visual/FreeTypeFontRasterizer.cpp
visual/GraphicsLoaderIntf.cpp
visual/GraphicsLoadThread.cpp
visual/ImageFunction.cpp
visual/LayerBitmapImpl.cpp
visual/LayerBitmapIntf.cpp
visual/LayerIntf.cpp
visual/LayerManager.cpp
visual/LayerTreeOwnerImpl.cpp
visual/LoadJPEG.cpp
visual/LoadPNG.cpp
visual/LoadTLG.cpp
visual/NullDrawDevice.cpp
visual/PrerenderedFont.cpp
visual/RectItf.cpp
visual/SaveTLG5.cpp
visual/SaveTLG6.cpp
visual/TransIntf.cpp
visual/tvpgl.c
visual/VideoOvlIntf.cpp
visual/WindowIntf.cpp
visual/android/BitmapBitsAlloc.cpp
visual/android/BitmapInfomation.cpp
visual/android/LayerImpl.cpp
visual/android/VideoOvlImpl.cpp
visual/android/WindowImpl.cpp
visual/gl/blend_function.cpp
visual/gl/ResampleImage.cpp
visual/gl/WeightFunctor.cpp
visual/opengl/CanvasIntf.cpp
visual/opengl/DrawCycleTimer.cpp
visual/opengl/GLFrameBufferObject.cpp
visual/opengl/GLShaderUtil.cpp
visual/opengl/Matrix32Intf.cpp
visual/opengl/Matrix44Intf.cpp
visual/opengl/OffscreenIntf.cpp
visual/opengl/OpenGLPlatformAndroid.cpp
visual/opengl/OpenGLScreen.cpp
visual/opengl/ShaderProgramIntf.cpp
visual/opengl/TextureIntf.cpp
visual/opengl/VertexBinderIntf.cpp
visual/opengl/VertexBufferIntf.cpp )
if( ANDROID_ABI STREQUAL x86 OR ANDROID_ABI STREQUAL x86_64 )
list(APPEND KRKRZ_SRC
sound/MathAlgorithms_SSE.cpp
sound/RealFFT_SSE.cpp
sound/WaveFormatConverter_SSE.cpp
sound/xmmlib.cpp )
endif()
if( ANDROID )
add_library( krkrz SHARED ${KRKRZ_SRC} )
endif()
# external library
add_subdirectory( external/freetype )
add_subdirectory( external/libjpeg-turbo )
add_subdirectory( external/lpng )
add_subdirectory( external/onig )
add_subdirectory( external/libogg )
add_subdirectory( external/opus )
add_subdirectory( external/opusfile )
if( ANDROID )
# cpufeature
include_directories( ${ANDROID_NDK}/sources/android/cpufeatures )
add_library( cpufeatures ${ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c )
# native_app_glue
# include_directories( ${ANDROID_NDK}/sources/android/native_app_glue )
# add_library(native_app_glue ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
# ndk_helper
#include_directories( ${ANDROID_NDK}/sources/android/ndk_helper ${ANDROID_NDK}/sources/android/native_app_glue )
#file( GLOB _NDK_HELPER_SRCS ${ANDROID_NDK}/sources/android/ndk_helper/*.cpp ${ANDROID_NDK}/sources/android/ndk_helper/gl3stub.c )
#add_library( ndk_helper ${_NDK_HELPER_SRCS} )
include_directories( ${ANDROID_NDK}/sources/android/ndk_helper )
add_library( ndk_helper ${ANDROID_NDK}/sources/android/ndk_helper/gl3stub.c )
find_library( log-lib log )
find_library( android-lib android )
find_library( EGL-lib EGL )
find_library( GLESv1_CM-lib GLESv1_CM )
find_library( GLESv2-lib GLESv2 )
find_library( z-lib z )
find_library( opensles OpenSLES )
# opusfile より opus/oggを後にリンクする必要があることに注意
target_link_libraries( krkrz
# Links the target library to the log library
# included in the NDK.
${log-lib}
${android-lib}
${EGL-lib}
${GLESv1_CM-lib}
${GLESv2-lib}
${z-lib}
${opensles}
atomic
# Links my library
freetype
jpeg-turbo
png
onig
opusfile
opus
ogg
#
cpufeatures
ndk_helper
)
endif()