| 7 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections") |
| 8 | set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--exclude-libs,libtgvoip.a,libtgcalls.a,libtgcalls_tp.a,libtgnet.a,liblz4.a,libwebp.a,libflac.a,librlottie.a,libsqlite.a, |
| 9 | ${CMAKE_HOME_DIRECTORY}/ffmpeg/${ANDROID_ABI}/libswscale.a, |
| 10 | ${CMAKE_HOME_DIRECTORY}/ffmpeg/${ANDROID_ABI}/libavformat.a, |
| 11 | ${CMAKE_HOME_DIRECTORY}/ffmpeg/${ANDROID_ABI}/libavcodec.a, |
| 12 | ${CMAKE_HOME_DIRECTORY}/ffmpeg/${ANDROID_ABI}/libavresample.a, |
| 13 | ${CMAKE_HOME_DIRECTORY}/ffmpeg/${ANDROID_ABI}/libavutil.a, |
| 14 | ${CMAKE_HOME_DIRECTORY}/ffmpeg/${ANDROID_ABI}/libswresample.a, |
| 15 | ${CMAKE_HOME_DIRECTORY}/boringssl/lib/libssl_${ANDROID_ABI}.a, |
| 16 | ${CMAKE_HOME_DIRECTORY}/boringssl/lib/libcrypto_${ANDROID_ABI}.a") |
| 17 |
| 18 | if (${ANDROID_ABI} STREQUAL "armeabi-v7a" OR ${ANDROID_ABI} STREQUAL "arm64-v8a") |
| 19 | enable_language(ASM) |
| 20 | else() |
| 21 | enable_language(ASM_NASM) |
| 22 | endif() |
| 23 |
| 24 | add_library(avutil STATIC IMPORTED) |
| 25 | set_target_properties(avutil PROPERTIES IMPORTED_LOCATION ${CMAKE_HOME_DIRECTORY}/ffmpeg/${ANDROID_ABI}/libavutil.a) |
| 26 |
| 27 | add_library(avformat STATIC IMPORTED) |
| 28 | set_target_properties(avformat PROPERTIES IMPORTED_LOCATION ${CMAKE_HOME_DIRECTORY}/ffmpeg/${ANDROID_ABI}/libavformat.a) |
| 29 |
| 30 | add_library(avcodec STATIC IMPORTED) |
| 31 | set_target_properties(avcodec PROPERTIES IMPORTED_LOCATION ${CMAKE_HOME_DIRECTORY}/ffmpeg/${ANDROID_ABI}/libavcodec.a) |
| 32 |
| 33 | add_library(avresample STATIC IMPORTED) |
| 34 | set_target_properties(avresample PROPERTIES IMPORTED_LOCATION ${CMAKE_HOME_DIRECTORY}/ffmpeg/${ANDROID_ABI}/libavresample.a) |
| 35 |
| 36 | add_library(swresample STATIC IMPORTED) |
| 37 | set_target_properties(swresample PROPERTIES IMPORTED_LOCATION ${CMAKE_HOME_DIRECTORY}/ffmpeg/${ANDROID_ABI}/libswresample.a) |
| 38 |
| 39 | add_library(swscale STATIC IMPORTED) |
| 40 | set_target_properties(swscale PROPERTIES IMPORTED_LOCATION ${CMAKE_HOME_DIRECTORY}/ffmpeg/${ANDROID_ABI}/libswscale.a) |
| 41 |
| 42 | add_library(crypto STATIC IMPORTED) |
| 43 | set_target_properties(crypto PROPERTIES IMPORTED_LOCATION ${CMAKE_HOME_DIRECTORY}/boringssl/lib/libcrypto_${ANDROID_ABI}.a) |
| 44 |
| 45 | add_library(ssl STATIC IMPORTED) |
| 46 | set_target_properties(ssl PROPERTIES IMPORTED_LOCATION ${CMAKE_HOME_DIRECTORY}/boringssl/lib/libssl_${ANDROID_ABI}.a) |
| 47 |
| 48 | #tgnet |
| 49 | add_library(mozjpeg STATIC |
| 50 | mozjpeg/cjpeg.c mozjpeg/cdjpeg.c mozjpeg/rdgif.c mozjpeg/rdppm.c mozjpeg/rdjpeg.c mozjpeg/rdswitch.c mozjpeg/rdbmp.c |
| 51 | mozjpeg/rdtarga.c mozjpeg/wrbmp.c mozjpeg/wrtarga.c mozjpeg/djpeg.c mozjpeg/cdjpeg.c mozjpeg/rdcolmap.c mozjpeg/rdswitch.c |
| 52 | mozjpeg/wrgif.c mozjpeg/wrppm.c mozjpeg/jpegtran.c mozjpeg/cdjpeg.c mozjpeg/rdswitch.c mozjpeg/transupp.c mozjpeg/turbojpeg.c |
| 53 | mozjpeg/jdatadst-tj.c mozjpeg/jdatasrc-tj.c mozjpeg/jcapimin.c mozjpeg/jcapistd.c mozjpeg/jccoefct.c mozjpeg/jccolor.c |
| 54 | mozjpeg/jcdctmgr.c mozjpeg/jchuff.c mozjpeg/jcext.c mozjpeg/jcicc.c mozjpeg/jcinit.c mozjpeg/jcmainct.c mozjpeg/jcmarker.c |
| 55 | mozjpeg/jcmaster.c mozjpeg/jcomapi.c mozjpeg/jcparam.c mozjpeg/jcphuff.c mozjpeg/jcprepct.c mozjpeg/jcsample.c |
| 56 | mozjpeg/jctrans.c mozjpeg/jdapimin.c mozjpeg/jdapistd.c mozjpeg/jdatadst.c mozjpeg/jdatasrc.c |
| 57 | mozjpeg/jdcoefct.c mozjpeg/jdcolor.c mozjpeg/jddctmgr.c mozjpeg/jdhuff.c mozjpeg/jdicc.c mozjpeg/jdinput.c |
| 58 | mozjpeg/jdmainct.c mozjpeg/jdmarker.c mozjpeg/jdmaster.c mozjpeg/jdmerge.c mozjpeg/jdphuff.c mozjpeg/jdpostct.c mozjpeg/jdsample.c |
| 59 | mozjpeg/jdtrans.c mozjpeg/jerror.c mozjpeg/jfdctflt.c mozjpeg/jfdctfst.c mozjpeg/jfdctint.c mozjpeg/jidctflt.c mozjpeg/jidctfst.c |
| 60 | mozjpeg/jidctint.c mozjpeg/jidctred.c mozjpeg/jquant1.c mozjpeg/jquant2.c mozjpeg/jutils.c mozjpeg/jmemmgr.c mozjpeg/jmemnobs.c) |
| 61 | target_compile_options(mozjpeg PUBLIC |
| 62 | -Os) |
| 63 | set_target_properties(mozjpeg PROPERTIES |
| 64 | ANDROID_ARM_MODE arm) |
| 65 | target_compile_definitions(mozjpeg PUBLIC |
| 66 | BMP_SUPPORTED GIF_SUPPORTED PPM_SUPPORTED TARGA_SUPPORTED) |
| 67 | target_include_directories(mozjpeg PUBLIC |
| 68 | mozjpeg |
| 69 | mozjpeg/simd/nasm) |
| 70 |
| 71 | if (${ANDROID_ABI} STREQUAL "armeabi-v7a") |
| 72 | target_sources(mozjpeg PRIVATE |
| 73 | mozjpeg/simd/arm/jsimd_neon.S |
| 74 | mozjpeg/simd/arm/jsimd.c) |
| 75 | target_compile_definitions(mozjpeg PUBLIC |
| 76 | SIZEOF_SIZE_T=4) |
| 77 | elseif(${ANDROID_ABI} STREQUAL "arm64-v8a") |
| 78 | target_sources(mozjpeg PRIVATE |
| 79 | mozjpeg/simd/arm64/jsimd_neon.S |
| 80 | mozjpeg/simd/arm64/jsimd.c) |
| 81 | target_compile_definitions(mozjpeg PUBLIC |
| 82 | SIZEOF_SIZE_T=8) |
| 83 | elseif(${ANDROID_ABI} STREQUAL "x86") |
| 84 | set(CMAKE_ASM_NASM_COMPILER_ARG1 "${CMAKE_ASM_NASM_COMPILER_ARG1} -DPIC") |
| 85 | target_sources(mozjpeg PRIVATE |
| 86 | mozjpeg/simd/i386/jsimd.c |
| 87 | mozjpeg/simd/i386/jsimdcpu.asm |
| 88 | mozjpeg/simd/i386/jfdctflt-3dn.asm |
| 89 | mozjpeg/simd/i386/jidctflt-3dn.asm |
| 90 | mozjpeg/simd/i386/jquant-3dn.asm |
| 91 | mozjpeg/simd/i386/jccolor-mmx.asm |
| 92 | mozjpeg/simd/i386/jcgray-mmx.asm |
| 93 | mozjpeg/simd/i386/jcsample-mmx.asm |
| 94 | mozjpeg/simd/i386/jdcolor-mmx.asm |
| 95 | mozjpeg/simd/i386/jdmerge-mmx.asm |
| 96 | mozjpeg/simd/i386/jdsample-mmx.asm |
| 97 | mozjpeg/simd/i386/jfdctfst-mmx.asm |
| 98 | mozjpeg/simd/i386/jfdctint-mmx.asm |
| 99 | mozjpeg/simd/i386/jidctfst-mmx.asm |
| 100 | mozjpeg/simd/i386/jidctint-mmx.asm |
| 101 | mozjpeg/simd/i386/jidctred-mmx.asm |
| 102 | mozjpeg/simd/i386/jquant-mmx.asm |
| 103 | mozjpeg/simd/i386/jfdctflt-sse.asm |
| 104 | mozjpeg/simd/i386/jidctflt-sse.asm |
| 105 | mozjpeg/simd/i386/jquant-sse.asm |
| 106 | mozjpeg/simd/i386/jccolor-sse2.asm |
| 107 | mozjpeg/simd/i386/jcgray-sse2.asm |
| 108 | mozjpeg/simd/i386/jchuff-sse2.asm |
| 109 | mozjpeg/simd/i386/jcphuff-sse2.asm |
| 110 | mozjpeg/simd/i386/jcsample-sse2.asm |
| 111 | mozjpeg/simd/i386/jdcolor-sse2.asm |
| 112 | mozjpeg/simd/i386/jdmerge-sse2.asm |
| 113 | mozjpeg/simd/i386/jdsample-sse2.asm |
| 114 | mozjpeg/simd/i386/jfdctfst-sse2.asm |
| 115 | mozjpeg/simd/i386/jfdctint-sse2.asm |
| 116 | mozjpeg/simd/i386/jidctflt-sse2.asm |
| 117 | mozjpeg/simd/i386/jidctfst-sse2.asm |
| 118 | mozjpeg/simd/i386/jidctint-sse2.asm |
| 119 | mozjpeg/simd/i386/jidctred-sse2.asm |
| 120 | mozjpeg/simd/i386/jquantf-sse2.asm |
| 121 | mozjpeg/simd/i386/jquanti-sse2.asm |
| 122 | mozjpeg/simd/i386/jccolor-avx2.asm |
| 123 | mozjpeg/simd/i386/jcgray-avx2.asm |
| 124 | mozjpeg/simd/i386/jcsample-avx2.asm |
| 125 | mozjpeg/simd/i386/jdcolor-avx2.asm |
| 126 | mozjpeg/simd/i386/jdmerge-avx2.asm |
| 127 | mozjpeg/simd/i386/jdsample-avx2.asm |
| 128 | mozjpeg/simd/i386/jfdctint-avx2.asm |
| 129 | mozjpeg/simd/i386/jidctint-avx2.asm |
| 130 | mozjpeg/simd/i386/jquanti-avx2.asm) |
| 131 | target_compile_definitions(mozjpeg PUBLIC |
| 132 | SIZEOF_SIZE_T=4) |
| 133 | elseif(${ANDROID_ABI} STREQUAL "x86_64") |
| 134 | set(CMAKE_ASM_NASM_COMPILER_ARG1 "${CMAKE_ASM_NASM_COMPILER_ARG1} -DPIC") |
| 135 | set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -DELF") |
| 136 | set(CMAKE_ASM_NASM_DEBUG_FORMAT "dwarf2") |
| 137 | set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -D__x86_64__") |
| 138 | target_sources(mozjpeg PRIVATE |
| 139 | mozjpeg/simd/x86_64/jsimd.c |
| 140 | mozjpeg/simd/x86_64/jsimdcpu.asm |
| 141 | mozjpeg/simd/x86_64/jfdctflt-sse.asm |
| 142 | mozjpeg/simd/x86_64/jccolor-sse2.asm |
| 143 | mozjpeg/simd/x86_64/jcgray-sse2.asm |
| 144 | mozjpeg/simd/x86_64/jchuff-sse2.asm |
| 145 | mozjpeg/simd/x86_64/jcphuff-sse2.asm |
| 146 | mozjpeg/simd/x86_64/jcsample-sse2.asm |
| 147 | mozjpeg/simd/x86_64/jdcolor-sse2.asm |
| 148 | mozjpeg/simd/x86_64/jdmerge-sse2.asm |
| 149 | mozjpeg/simd/x86_64/jdsample-sse2.asm |
| 150 | mozjpeg/simd/x86_64/jfdctfst-sse2.asm |
| 151 | mozjpeg/simd/x86_64/jfdctint-sse2.asm |
| 152 | mozjpeg/simd/x86_64/jidctflt-sse2.asm |
| 153 | mozjpeg/simd/x86_64/jidctfst-sse2.asm |
| 154 | mozjpeg/simd/x86_64/jidctint-sse2.asm |
| 155 | mozjpeg/simd/x86_64/jidctred-sse2.asm |
| 156 | mozjpeg/simd/x86_64/jquantf-sse2.asm |
| 157 | mozjpeg/simd/x86_64/jquanti-sse2.asm |
| 158 | mozjpeg/simd/x86_64/jccolor-avx2.asm |
| 159 | mozjpeg/simd/x86_64/jcgray-avx2.asm |
| 160 | mozjpeg/simd/x86_64/jcsample-avx2.asm |
| 161 | mozjpeg/simd/x86_64/jdcolor-avx2.asm |
| 162 | mozjpeg/simd/x86_64/jdmerge-avx2.asm |
| 163 | mozjpeg/simd/x86_64/jdsample-avx2.asm |
| 164 | mozjpeg/simd/x86_64/jfdctint-avx2.asm |
| 165 | mozjpeg/simd/x86_64/jidctint-avx2.asm |
| 166 | mozjpeg/simd/x86_64/jquanti-avx2.asm) |
| 167 | target_compile_definitions(mozjpeg PUBLIC |
| 168 | SIZEOF_SIZE_T=8) |
| 169 | endif() |
| 170 |
| 171 | #tgnet |
| 172 | add_library(tgnet STATIC |
| 173 | tgnet/ApiScheme.cpp |
| 174 | tgnet/BuffersStorage.cpp |
| 175 | tgnet/ByteArray.cpp |
| 176 | tgnet/ByteStream.cpp |
| 177 | tgnet/Connection.cpp |
| 178 | tgnet/ConnectionSession.cpp |
| 179 | tgnet/ConnectionsManager.cpp |
| 180 | tgnet/ConnectionSocket.cpp |
| 181 | tgnet/Datacenter.cpp |
| 182 | tgnet/EventObject.cpp |
| 183 | tgnet/FileLog.cpp |
| 184 | tgnet/MTProtoScheme.cpp |
| 185 | tgnet/NativeByteBuffer.cpp |
| 186 | tgnet/Request.cpp |
| 187 | tgnet/Timer.cpp |
| 188 | tgnet/TLObject.cpp |
| 189 | tgnet/ProxyCheckInfo.cpp |
| 190 | tgnet/Handshake.cpp |
| 191 | tgnet/Config.cpp) |
| 192 | target_compile_options(tgnet PUBLIC |
| 193 | -Wall -frtti -finline-functions -ffast-math -Os) |
| 194 | set_target_properties(tgnet PROPERTIES |
| 195 | ANDROID_ARM_MODE arm) |
| 196 | target_compile_definitions(tgnet PUBLIC |
| 197 | HAVE_PTHREAD) |
| 198 | target_include_directories(tgnet PUBLIC |
| 199 | boringssl/include/) |
| 200 | target_link_libraries(tgnet |
| 201 | crypto) |
| 202 |
| 203 | #rlottie |
| 204 | add_library(rlottie STATIC |
| 205 | rlottie/src/lottie/lottieanimation.cpp |
| 206 | rlottie/src/lottie/lottieitem.cpp |
| 207 | rlottie/src/lottie/lottiekeypath.cpp |
| 208 | rlottie/src/lottie/lottieloader.cpp |
| 209 | rlottie/src/lottie/lottiemodel.cpp |
| 210 | rlottie/src/lottie/lottieparser.cpp |
| 211 | rlottie/src/lottie/lottieproxymodel.cpp |
| 212 | rlottie/src/vector/freetype/v_ft_math.cpp |
| 213 | rlottie/src/vector/freetype/v_ft_raster.cpp |
| 214 | rlottie/src/vector/freetype/v_ft_stroker.cpp |
| 215 | rlottie/src/vector/pixman/vregion.cpp |
| 216 | rlottie/src/vector/stb/stb_image.cpp |
| 217 | rlottie/src/vector/vbezier.cpp |
| 218 | rlottie/src/vector/vbitmap.cpp |
| 219 | rlottie/src/vector/vbrush.cpp |
| 220 | rlottie/src/vector/vcompositionfunctions.cpp |
| 221 | rlottie/src/vector/vdasher.cpp |
| 222 | rlottie/src/vector/vdebug.cpp |
| 223 | rlottie/src/vector/vdrawable.cpp |
| 224 | rlottie/src/vector/vdrawhelper.cpp |
| 225 | rlottie/src/vector/vdrawhelper_neon.cpp |
| 226 | rlottie/src/vector/velapsedtimer.cpp |
| 227 | rlottie/src/vector/vimageloader.cpp |
| 228 | rlottie/src/vector/vinterpolator.cpp |
| 229 | rlottie/src/vector/vmatrix.cpp |
| 230 | rlottie/src/vector/vpainter.cpp |
| 231 | rlottie/src/vector/vpath.cpp |
| 232 | rlottie/src/vector/vpathmesure.cpp |
| 233 | rlottie/src/vector/vraster.cpp |
| 234 | rlottie/src/vector/vrect.cpp |
| 235 | rlottie/src/vector/vrle.cpp) |
| 236 | target_compile_options(rlottie PUBLIC |
| 237 | -Wall -fno-rtti -finline-functions -ffast-math -Os -fno-unwind-tables -fno-asynchronous-unwind-tables -Wnon-virtual-dtor -Woverloaded-virtual -Wno-unused-parameter -fvisibility=hidden) |
| 238 | set_target_properties(rlottie PROPERTIES |
| 239 | ANDROID_ARM_MODE arm) |
| 240 | target_compile_definitions(rlottie PUBLIC |
| 241 | HAVE_PTHREAD NDEBUG) |
| 242 | target_include_directories(rlottie PUBLIC |
| 243 | ./ |
| 244 | rlottie/inc |
| 245 | rlottie/src/vector/ |
| 246 | rlottie/src/vector/pixman |
| 247 | rlottie/src/vector/freetype |
| 248 | rlottie/src/vector/stb) |
| 249 |
| 250 | if (${ANDROID_ABI} STREQUAL "armeabi-v7a") |
| 251 | target_compile_options(rlottie PUBLIC |
| 252 | -fno-integrated-as) |
| 253 | target_compile_definitions(rlottie PUBLIC |
| 254 | USE_ARM_NEON) |
| 255 | target_sources(rlottie PRIVATE |
| 256 | rlottie/src/vector/pixman/pixman-arm-neon-asm.S) |
| 257 | elseif(${ANDROID_ABI} STREQUAL "arm64-v8a") |
| 258 | target_compile_options(rlottie PUBLIC |
| 259 | -fno-integrated-as) |
| 260 | target_compile_definitions(rlottie PUBLIC |
| 261 | USE_ARM_NEON __ARM64_NEON__) |
| 262 | target_sources(rlottie PRIVATE |
| 263 | rlottie/src/vector/pixman/pixman-arma64-neon-asm.S) |
| 264 | endif() |
| 265 |
| 266 | #flac |
| 267 | add_library(flac STATIC |
| 268 | exoplayer/libFLAC/bitmath.c |
| 269 | exoplayer/libFLAC/bitreader.c |
| 270 | exoplayer/libFLAC/bitwriter.c |
| 271 | exoplayer/libFLAC/cpu.c |
| 272 | exoplayer/libFLAC/crc.c |
| 273 | exoplayer/libFLAC/fixed.c |
| 274 | exoplayer/libFLAC/fixed_intrin_sse2.c |
| 275 | exoplayer/libFLAC/fixed_intrin_ssse3.c |
| 276 | exoplayer/libFLAC/float.c |
| 277 | exoplayer/libFLAC/format.c |
| 278 | exoplayer/libFLAC/lpc.c |
| 279 | exoplayer/libFLAC/lpc_intrin_avx2.c |
| 280 | exoplayer/libFLAC/lpc_intrin_sse2.c |
| 281 | exoplayer/libFLAC/lpc_intrin_sse41.c |
| 282 | exoplayer/libFLAC/lpc_intrin_sse.c |
| 283 | exoplayer/libFLAC/md5.c |
| 284 | exoplayer/libFLAC/memory.c |
| 285 | exoplayer/libFLAC/metadata_iterators.c |
| 286 | exoplayer/libFLAC/metadata_object.c |
| 287 | exoplayer/libFLAC/stream_decoder.c |
| 288 | exoplayer/libFLAC/stream_encoder.c |
| 289 | exoplayer/libFLAC/stream_encoder_framing.c |
| 290 | exoplayer/libFLAC/stream_encoder_intrin_avx2.c |
| 291 | exoplayer/libFLAC/stream_encoder_intrin_sse2.c |
| 292 | exoplayer/libFLAC/stream_encoder_intrin_ssse3.c |
| 293 | exoplayer/libFLAC/window.c) |
| 294 | target_compile_options(flac PUBLIC |
| 295 | -O3 -funroll-loops -finline-functions -fPIC -frtti) |
| 296 | set_target_properties(flac PROPERTIES |
| 297 | ANDROID_ARM_MODE arm) |
| 298 | target_compile_definitions(flac PUBLIC |
| 299 | _REENTRANT PIC U_COMMON_IMPLEMENTATION HAVE_SYS_PARAM_H VERSION="1.3.1" FLAC__NO_MD5 FLAC__INTEGER_ONLY_LIBRARY FLAC__NO_ASM) |
| 300 | target_include_directories(flac PUBLIC |
| 301 | exoplayer/libFLAC/include) |
| 302 |
| 303 | #webp |
| 304 | add_library(webp STATIC |
| 305 | libwebp/dec/alpha.c |
| 306 | libwebp/dec/buffer.c |
| 307 | libwebp/dec/frame.c |
| 308 | libwebp/dec/idec.c |
| 309 | libwebp/dec/io.c |
| 310 | libwebp/dec/quant.c |
| 311 | libwebp/dec/tree.c |
| 312 | libwebp/dec/vp8.c |
| 313 | libwebp/dec/vp8l.c |
| 314 | libwebp/dec/webp.c |
| 315 | libwebp/dsp/alpha_processing.c |
| 316 | libwebp/dsp/alpha_processing_sse2.c |
| 317 | libwebp/dsp/cpu.c |
| 318 | libwebp/dsp/dec.c |
| 319 | libwebp/dsp/dec_clip_tables.c |
| 320 | libwebp/dsp/dec_mips32.c |
| 321 | libwebp/dsp/dec_neon.c |
| 322 | libwebp/dsp/dec_sse2.c |
| 323 | libwebp/dsp/enc.c |
| 324 | libwebp/dsp/enc_avx2.c |
| 325 | libwebp/dsp/enc_mips32.c |
| 326 | libwebp/dsp/enc_neon.c |
| 327 | libwebp/dsp/enc_sse2.c |
| 328 | libwebp/dsp/lossless.c |
| 329 | libwebp/dsp/lossless_mips32.c |
| 330 | libwebp/dsp/lossless_neon.c |
| 331 | libwebp/dsp/lossless_sse2.c |
| 332 | libwebp/dsp/upsampling.c |
| 333 | libwebp/dsp/upsampling_neon.c |
| 334 | libwebp/dsp/upsampling_sse2.c |
| 335 | libwebp/dsp/yuv.c |
| 336 | libwebp/dsp/yuv_mips32.c |
| 337 | libwebp/dsp/yuv_sse2.c |
| 338 | libwebp/enc/alpha.c |
| 339 | libwebp/enc/analysis.c |
| 340 | libwebp/enc/backward_references.c |
| 341 | libwebp/enc/config.c |
| 342 | libwebp/enc/cost.c |
| 343 | libwebp/enc/filter.c |
| 344 | libwebp/enc/frame.c |
| 345 | libwebp/enc/histogram.c |
| 346 | libwebp/enc/iterator.c |
| 347 | libwebp/enc/picture.c |
| 348 | libwebp/enc/picture_csp.c |
| 349 | libwebp/enc/picture_psnr.c |
| 350 | libwebp/enc/picture_rescale.c |
| 351 | libwebp/enc/picture_tools.c |
| 352 | libwebp/enc/quant.c |
| 353 | libwebp/enc/syntax.c |
| 354 | libwebp/enc/token.c |
| 355 | libwebp/enc/tree.c |
| 356 | libwebp/enc/vp8l.c |
| 357 | libwebp/enc/webpenc.c |
| 358 | libwebp/utils/bit_reader.c |
| 359 | libwebp/utils/bit_writer.c |
| 360 | libwebp/utils/color_cache.c |
| 361 | libwebp/utils/filters.c |
| 362 | libwebp/utils/huffman.c |
| 363 | libwebp/utils/huffman_encode.c |
| 364 | libwebp/utils/quant_levels.c |
| 365 | libwebp/utils/quant_levels_dec.c |
| 366 | libwebp/utils/random.c |
| 367 | libwebp/utils/rescaler.c |
| 368 | libwebp/utils/thread.c |
| 369 | libwebp/utils/utils.c) |
| 370 | target_compile_options(webp PUBLIC |
| 371 | -Wall -finline-functions -ffast-math -Os) |
| 372 | set_target_properties(webp PROPERTIES |
| 373 | ANDROID_ARM_MODE arm) |
| 374 | target_compile_definitions(webp PUBLIC |
| 375 | HAVE_MALLOC_H HAVE_PTHREAD WEBP_USE_THREAD) |
| 376 | target_include_directories(webp PUBLIC |
| 377 | libwebp/src) |
| 378 |
| 379 | #lz4 |
| 380 | add_library(lz4 STATIC |
| 381 | lz4/lz4.c |
| 382 | lz4/lz4frame.c |
| 383 | lz4/xxhash.c) |
| 384 | target_compile_options(lz4 PUBLIC |
| 385 | -w -O3) |
| 386 | set_target_properties(lz4 PROPERTIES |
| 387 | ANDROID_ARM_MODE arm) |
| 388 |
| 389 | #sqlite |
| 390 | add_library(sqlite STATIC |
| 391 | sqlite/sqlite3.c) |
| 392 | target_compile_options(sqlite PUBLIC |
| 393 | -fno-strict-aliasing -Os) |
| 394 | set_target_properties(sqlite PROPERTIES |
| 395 | ANDROID_ARM_MODE arm) |
| 396 | target_compile_definitions(sqlite PUBLIC |
| 397 | NULL=0 SOCKLEN_T=socklen_t LOCALE_NOT_USED ANDROID_NDK DISABLE_IMPORTGL AVOID_TABLES ANDROID_TILE_BASED_DECODE HAVE_STRCHRNUL=0 ANDROID_ARMV6_IDCT) |
| 398 |
| 399 | #voip |
| 400 | include(${CMAKE_HOME_DIRECTORY}/voip/CMakeLists.txt) |
| 401 |
| 402 | set(NATIVE_LIB "tmessages.40") |
| 403 |
| 404 | #tmessages |
| 405 | add_library(${NATIVE_LIB} SHARED |
| 406 | jni.c |
| 407 | audio.c |
| 408 | image.cpp |
| 409 | video.c |
| 410 | intro/IntroRenderer.c |
| 411 | SqliteWrapper.cpp |
| 412 | utilities.cpp |
| 413 | gifvideo.cpp |
| 414 | lottie.cpp |
| 415 | TgNetWrapper.cpp |
| 416 | NativeLoader.cpp |
| 417 | exoplayer/flac_jni.cc |
| 418 | exoplayer/flac_parser.cc |
| 419 | exoplayer/opus_jni.cc |
| 420 | exoplayer/ffmpeg_jni.cc |
| 421 | fast-edge.cpp |
| 422 | genann.c |
| 423 | secureid_ocr.cpp) |
| 424 |
| 425 | target_compile_options(${NATIVE_LIB} PUBLIC |
| 426 | -ffast-math -Os -funroll-loops -ffast-math -fno-strict-aliasing -fno-math-errno) |
| 427 |
| 428 | target_compile_definitions(${NATIVE_LIB} PUBLIC |
| 429 | BSD=1 NULL=0 SOCKLEN_T=socklen_t ANDROID_NDK DISABLE_IMPORTGL AVOID_TABLES ANDROID_TILE_BASED_DECODE __STDC_CONSTANT_MACROS ANDROID_ARMV6_IDCT OPUS_BUILD FIXED_POINT USE_ALLOCA restrict= __EMX__ LOCALE_NOT_USED HAVE_LRINT HAVE_LRINTF) |
| 430 |
| 431 | if (${ANDROID_ABI} STREQUAL "armeabi-v7a") |
| 432 | set_target_properties(${NATIVE_LIB} PROPERTIES |
| 433 | ANDROID_ARM_NEON FALSE |
| 434 | ANDROID_ARM_MODE arm) |
| 435 | target_compile_definitions(${NATIVE_LIB} PUBLIC |
| 436 | ANDROID_ARM_NEON=false) |
| 437 | target_sources(${NATIVE_LIB} PRIVATE |
| 438 | third_party/libyuv/source/compare_neon.cc |
| 439 | third_party/libyuv/source/rotate_neon.cc |
| 440 | third_party/libyuv/source/row_neon.cc |
| 441 | third_party/libyuv/source/scale_neon.cc) |
| 442 | else() |
| 443 | set_target_properties(${NATIVE_LIB} PROPERTIES |
| 444 | ANDROID_ARM_NEON FALSE |
| 445 | ANDROID_ARM_MODE arm) |
| 446 | endif() |
| 447 |
| 448 | if (${ANDROID_ABI} STREQUAL "armeabi-v7a" OR ${ANDROID_ABI} STREQUAL "arm64-v8a") |
| 449 | target_compile_definitions(${NATIVE_LIB} PUBLIC |
| 450 | LIBYUV_NEON OPUS_HAVE_RTCD OPUS_ARM_ASM) |
| 451 |
| 452 | target_sources(${NATIVE_LIB} PRIVATE |
| 453 | opus/celt/arm/celt_neon_intr.c |
| 454 | opus/celt/arm/pitch_neon_intr.c |
| 455 | opus/silk/arm/NSQ_neon.c |
| 456 | opus/silk/arm/arm_silk_map.c |
| 457 | opus/silk/arm/LPC_inv_pred_gain_neon_intr.c |
| 458 | opus/silk/arm/NSQ_del_dec_neon_intr.c |
| 459 | opus/silk/arm/biquad_alt_neon_intr.c |
| 460 | opus/silk/fixed/arm/warped_autocorrelation_FIX_neon_intr.c |
| 461 | ) |
| 462 |
| 463 | elseif(${ANDROID_ABI} STREQUAL "x86") |
| 464 | target_compile_definitions(${NATIVE_LIB} PUBLIC |
| 465 | x86fix) |
| 466 | endif() |
| 467 |
| 468 | target_sources(${NATIVE_LIB} PRIVATE |
| 469 |
| 470 | opus/src/opus.c |
| 471 | opus/src/opus_decoder.c |
| 472 | opus/src/opus_encoder.c |
| 473 | opus/src/opus_multistream.c |
| 474 | opus/src/opus_multistream_encoder.c |
| 475 | opus/src/opus_multistream_decoder.c |
| 476 | opus/src/repacketizer.c |
| 477 | opus/src/analysis.c |
| 478 | opus/src/mlp.c |
| 479 | opus/src/mlp_data.c |
| 480 | opus/src/opus_projection_encoder.c |
| 481 | opus/src/opus_projection_decoder.c |
| 482 | opus/src/mapping_matrix.c |
| 483 |
| 484 | opus/silk/CNG.c |
| 485 | opus/silk/code_signs.c |
| 486 | opus/silk/init_decoder.c |
| 487 | opus/silk/decode_core.c |
| 488 | opus/silk/decode_frame.c |
| 489 | opus/silk/decode_parameters.c |
| 490 | opus/silk/decode_indices.c |
| 491 | opus/silk/decode_pulses.c |
| 492 | opus/silk/decoder_set_fs.c |
| 493 | opus/silk/dec_API.c |
| 494 | opus/silk/enc_API.c |
| 495 | opus/silk/encode_indices.c |
| 496 | opus/silk/encode_pulses.c |
| 497 | opus/silk/gain_quant.c |
| 498 | opus/silk/interpolate.c |
| 499 | opus/silk/LP_variable_cutoff.c |
| 500 | opus/silk/NLSF_decode.c |
| 501 | opus/silk/NSQ.c |
| 502 | opus/silk/NSQ_del_dec.c |
| 503 | opus/silk/PLC.c |
| 504 | opus/silk/shell_coder.c |
| 505 | opus/silk/tables_gain.c |
| 506 | opus/silk/tables_LTP.c |
| 507 | opus/silk/tables_NLSF_CB_NB_MB.c |
| 508 | opus/silk/tables_NLSF_CB_WB.c |
| 509 | opus/silk/tables_other.c |
| 510 | opus/silk/tables_pitch_lag.c |
| 511 | opus/silk/tables_pulses_per_block.c |
| 512 | opus/silk/VAD.c |
| 513 | opus/silk/control_audio_bandwidth.c |
| 514 | opus/silk/quant_LTP_gains.c |
| 515 | opus/silk/VQ_WMat_EC.c |
| 516 | opus/silk/HP_variable_cutoff.c |
| 517 | opus/silk/NLSF_encode.c |
| 518 | opus/silk/NLSF_VQ.c |
| 519 | opus/silk/NLSF_unpack.c |
| 520 | opus/silk/NLSF_del_dec_quant.c |
| 521 | opus/silk/process_NLSFs.c |
| 522 | opus/silk/stereo_LR_to_MS.c |
| 523 | opus/silk/stereo_MS_to_LR.c |
| 524 | opus/silk/check_control_input.c |
| 525 | opus/silk/control_SNR.c |
| 526 | opus/silk/init_encoder.c |
| 527 | opus/silk/control_codec.c |
| 528 | opus/silk/A2NLSF.c |
| 529 | opus/silk/ana_filt_bank_1.c |
| 530 | opus/silk/biquad_alt.c |
| 531 | opus/silk/bwexpander_32.c |
| 532 | opus/silk/bwexpander.c |
| 533 | opus/silk/debug.c |
| 534 | opus/silk/decode_pitch.c |
| 535 | opus/silk/inner_prod_aligned.c |
| 536 | opus/silk/lin2log.c |
| 537 | opus/silk/log2lin.c |
| 538 | opus/silk/LPC_analysis_filter.c |
| 539 | opus/silk/LPC_inv_pred_gain.c |
| 540 | opus/silk/table_LSF_cos.c |
| 541 | opus/silk/NLSF2A.c |
| 542 | opus/silk/NLSF_stabilize.c |
| 543 | opus/silk/NLSF_VQ_weights_laroia.c |
| 544 | opus/silk/pitch_est_tables.c |
| 545 | opus/silk/resampler.c |
| 546 | opus/silk/resampler_down2_3.c |
| 547 | opus/silk/resampler_down2.c |
| 548 | opus/silk/resampler_private_AR2.c |
| 549 | opus/silk/resampler_private_down_FIR.c |
| 550 | opus/silk/resampler_private_IIR_FIR.c |
| 551 | opus/silk/resampler_private_up2_HQ.c |
| 552 | opus/silk/resampler_rom.c |
| 553 | opus/silk/sigm_Q15.c |
| 554 | opus/silk/sort.c |
| 555 | opus/silk/sum_sqr_shift.c |
| 556 | opus/silk/stereo_decode_pred.c |
| 557 | opus/silk/stereo_encode_pred.c |
| 558 | opus/silk/stereo_find_predictor.c |
| 559 | opus/silk/stereo_quant_pred.c |
| 560 | opus/silk/LPC_fit.c |
| 561 |
| 562 | opus/silk/fixed/LTP_analysis_filter_FIX.c |
| 563 | opus/silk/fixed/LTP_scale_ctrl_FIX.c |
| 564 | opus/silk/fixed/corrMatrix_FIX.c |
| 565 | opus/silk/fixed/encode_frame_FIX.c |
| 566 | opus/silk/fixed/find_LPC_FIX.c |
| 567 | opus/silk/fixed/find_LTP_FIX.c |
| 568 | opus/silk/fixed/find_pitch_lags_FIX.c |
| 569 | opus/silk/fixed/find_pred_coefs_FIX.c |
| 570 | opus/silk/fixed/noise_shape_analysis_FIX.c |
| 571 | opus/silk/fixed/process_gains_FIX.c |
| 572 | opus/silk/fixed/regularize_correlations_FIX.c |
| 573 | opus/silk/fixed/residual_energy16_FIX.c |
| 574 | opus/silk/fixed/residual_energy_FIX.c |
| 575 | opus/silk/fixed/warped_autocorrelation_FIX.c |
| 576 | opus/silk/fixed/apply_sine_window_FIX.c |
| 577 | opus/silk/fixed/autocorr_FIX.c |
| 578 | opus/silk/fixed/burg_modified_FIX.c |
| 579 | opus/silk/fixed/k2a_FIX.c |
| 580 | opus/silk/fixed/k2a_Q16_FIX.c |
| 581 | opus/silk/fixed/pitch_analysis_core_FIX.c |
| 582 | opus/silk/fixed/vector_ops_FIX.c |
| 583 | opus/silk/fixed/schur64_FIX.c |
| 584 | opus/silk/fixed/schur_FIX.c |
| 585 |
| 586 | opus/celt/bands.c |
| 587 | opus/celt/celt.c |
| 588 | opus/celt/celt_encoder.c |
| 589 | opus/celt/celt_decoder.c |
| 590 | opus/celt/cwrs.c |
| 591 | opus/celt/entcode.c |
| 592 | opus/celt/entdec.c |
| 593 | opus/celt/entenc.c |
| 594 | opus/celt/kiss_fft.c |
| 595 | opus/celt/laplace.c |
| 596 | opus/celt/mathops.c |
| 597 | opus/celt/mdct.c |
| 598 | opus/celt/modes.c |
| 599 | opus/celt/pitch.c |
| 600 | opus/celt/celt_lpc.c |
| 601 | opus/celt/quant_bands.c |
| 602 | opus/celt/rate.c |
| 603 | opus/celt/vq.c |
| 604 | opus/celt/arm/armcpu.c |
| 605 | opus/celt/arm/arm_celt_map.c |
| 606 |
| 607 | opus/ogg/bitwise.c |
| 608 | opus/ogg/framing.c |
| 609 | opus/opusfile/info.c |
| 610 | opus/opusfile/internal.c |
| 611 | opus/opusfile/opusfile.c |
| 612 | opus/opusfile/stream.c |
| 613 |
| 614 | third_party/libyuv/source/compare_common.cc |
| 615 | third_party/libyuv/source/compare_gcc.cc |
| 616 | third_party/libyuv/source/compare_neon64.cc |
| 617 | third_party/libyuv/source/compare_win.cc |
| 618 | third_party/libyuv/source/compare.cc |
| 619 | third_party/libyuv/source/convert_argb.cc |
| 620 | third_party/libyuv/source/convert_from_argb.cc |
| 621 | third_party/libyuv/source/convert_from.cc |
| 622 | third_party/libyuv/source/convert_jpeg.cc |
| 623 | third_party/libyuv/source/convert_to_argb.cc |
| 624 | third_party/libyuv/source/convert_to_i420.cc |
| 625 | third_party/libyuv/source/convert.cc |
| 626 | third_party/libyuv/source/cpu_id.cc |
| 627 | third_party/libyuv/source/mjpeg_decoder.cc |
| 628 | third_party/libyuv/source/mjpeg_validate.cc |
| 629 | third_party/libyuv/source/planar_functions.cc |
| 630 | third_party/libyuv/source/rotate_any.cc |
| 631 | third_party/libyuv/source/rotate_argb.cc |
| 632 | third_party/libyuv/source/rotate_common.cc |
| 633 | third_party/libyuv/source/rotate_gcc.cc |
| 634 | third_party/libyuv/source/rotate_neon64.cc |
| 635 | third_party/libyuv/source/rotate_win.cc |
| 636 | third_party/libyuv/source/rotate.cc |
| 637 | third_party/libyuv/source/row_any.cc |
| 638 | third_party/libyuv/source/row_common.cc |
| 639 | third_party/libyuv/source/row_gcc.cc |
| 640 | third_party/libyuv/source/row_neon64.cc |
| 641 | third_party/libyuv/source/row_win.cc |
| 642 | third_party/libyuv/source/scale_any.cc |
| 643 | third_party/libyuv/source/scale_argb.cc |
| 644 | third_party/libyuv/source/scale_common.cc |
| 645 | third_party/libyuv/source/scale_gcc.cc |
| 646 | third_party/libyuv/source/scale_neon64.cc |
| 647 | third_party/libyuv/source/scale_win.cc |
| 648 | third_party/libyuv/source/scale.cc |
| 649 | third_party/libyuv/source/video_common.cc |
| 650 | third_party/libyuv/source/scale_uv.cc) |
| 651 |
| 652 | target_include_directories(${NATIVE_LIB} PUBLIC |
| 653 | opus/include |
| 654 | opus/silk |
| 655 | opus/silk/fixed |
| 656 | opus/celt |
| 657 | opus/ |
| 658 | opus/opusfile |
| 659 | third_party/libyuv/include |
| 660 | boringssl/include |
| 661 | ffmpeg/include |
| 662 | emoji |
| 663 | exoplayer/include |
| 664 | exoplayer/libFLAC/include |
| 665 | intro |
| 666 | rlottie/inc |
| 667 | tgcalls/ |
| 668 | webrtc/ |
| 669 | lz4) |
| 670 |
| 671 | target_link_libraries(${NATIVE_LIB} |
| 672 | -Wl,--whole-archive rnnoise openh264 voipandroid -Wl,--no-whole-archive |
| 673 | tgvoip |
| 674 | tgcalls |
| 675 | tgcalls_tp |
| 676 | mozjpeg |
| 677 | tgnet |
| 678 | lz4 |
| 679 | webp |
| 680 | flac |
| 681 | rlottie |
| 682 | sqlite |
| 683 | swscale |
| 684 | avformat |
| 685 | avcodec |
| 686 | avresample |
| 687 | swresample |
| 688 | avutil |
| 689 | ssl |
| 690 | crypto |
| 691 | jnigraphics |
| 692 | log |
| 693 | z |
| 694 | GLESv2 |
| 695 | EGL |
| 696 | android |
| 697 | OpenSLES |
| 698 | cpufeatures) |
| 699 |
| 700 | if (${ANDROID_ABI} STREQUAL "x86" OR ${ANDROID_ABI} STREQUAL "x86_64") |
| 701 | target_link_libraries(${NATIVE_LIB} |
| 702 | -Wl,--whole-archive libvpx_yasm -Wl,--no-whole-archive) |
| 703 | endif() |
| 704 |
| 705 | #if (${ANDROID_ABI} STREQUAL "x86" OR ${ANDROID_ABI} STREQUAL "x86_64") |
| 706 | # target_link_libraries(${NATIVE_LIB} |
| 707 | # -Wl,--whole-archive vpxasm -Wl,--no-whole-archive |
| 708 | # c) |
| 709 | #endif() |
| 710 |
| 711 | include(AndroidNdkModules) |
| 712 | android_ndk_import_module_cpufeatures() |