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