load("//Config:buck_rule_macros.bzl", "static_library", "framework", "glob_map", "glob_sub_map", "merge_maps") genrule( name = "openssl_libs", srcs = [ "openssl/iOS/libcrypto.a", ], bash = "mkdir -p $OUT; cp $SRCS $OUT/", out = "openssl_libs", visibility = ["PUBLIC"] ) apple_library( name = "openssl", visibility = [ "//submodules/MtProtoKit:MtProtoKit" ], header_namespace = "openssl", exported_headers = glob([ "openssl/**/*.h", ]), exported_linker_flags = [ "-lcrypto", "-L$(location :openssl_libs)", ], ) ton_lib_names = [ "adnllite", "crc32c", "keys", "lite-client-common", "tdactor", "tddb", "tdnet", "tdutils", "tl-lite-utils", "tl-utils", "tl_api", "tl_lite_api", "tl_tonlib_api", "ton_block", "ton_crypto", "tonlib", ] ton_lib_flags = ["-l" + name for name in ton_lib_names] genrule( name = "ton_libs", srcs = glob([ "TON/iOS/lib/*.a", ]), bash = "mkdir -p $OUT; cp $SRCS $OUT/", out = "ton_libs", visibility = ["PUBLIC"] ) apple_library( name = "ton", visibility = [ "//submodules/MtProtoKit:MtProtoKit" ], exported_headers = [], exported_linker_flags = [ "-L$(location :ton_libs)", ] + ton_lib_flags, ) framework( name = "MtProtoKit", srcs = glob([ "*.m", "MtProtoKit/*.m", "thirdparty/AFNetworking/*.m", "thirdparty/AsyncSocket/*.m", "TON/*.m", "TON/*.mm", ]), headers = merge_maps([ glob_map(glob([ "*.h", "MtProtoKit/*.h", "thirdparty/AFNetworking/*.h", "thirdparty/AsyncSocket/*.h", "TON/*.h", ])), glob_sub_map("TON/iOS/include/", glob([ "TON/iOS/include/**/*.h", ])), ]), exported_headers = [ "MtProtoKit/MTTime.h", "MtProtoKit/MTTimer.h", "MtProtoKit/MTLogging.h", "MtProtoKit/MTEncryption.h", "MtProtoKit/MTInternalId.h", "MtProtoKit/MTQueue.h", "MtProtoKit/MTOutputStream.h", "MtProtoKit/MTInputStream.h", "MtProtoKit/MTSerialization.h", "MtProtoKit/MTExportedAuthorizationData.h", "MtProtoKit/MTRpcError.h", "MtProtoKit/MTKeychain.h", "MtProtoKit/MTFileBasedKeychain.h", "MtProtoKit/MTContext.h", "MtProtoKit/MTTransportScheme.h", "MtProtoKit/MTDatacenterTransferAuthAction.h", "MtProtoKit/MTDatacenterAuthAction.h", "MtProtoKit/MTDatacenterAuthMessageService.h", "MtProtoKit/MTDatacenterAddress.h", "MtProtoKit/MTDatacenterAddressSet.h", "MtProtoKit/MTDatacenterAuthInfo.h", "MtProtoKit/MTDatacenterSaltInfo.h", "MtProtoKit/MTDatacenterAddressListData.h", "MtProtoKit/MTProto.h", "MtProtoKit/MTSessionInfo.h", "MtProtoKit/MTTimeFixContext.h", "MtProtoKit/MTPreparedMessage.h", "MtProtoKit/MTOutgoingMessage.h", "MtProtoKit/MTIncomingMessage.h", "MtProtoKit/MTMessageEncryptionKey.h", "MtProtoKit/MTMessageService.h", "MtProtoKit/MTMessageTransaction.h", "MtProtoKit/MTTimeSyncMessageService.h", "MtProtoKit/MTRequestMessageService.h", "MtProtoKit/MTRequest.h", "MtProtoKit/MTRequestContext.h", "MtProtoKit/MTRequestErrorContext.h", "MtProtoKit/MTDropResponseContext.h", "MtProtoKit/MTApiEnvironment.h", "MtProtoKit/MTResendMessageService.h", "MtProtoKit/MTNetworkAvailability.h", "MtProtoKit/MTTransport.h", "MtProtoKit/MTTransportTransaction.h", "MtProtoKit/MTTcpTransport.h", "MtProtoKit/MTHttpRequestOperation.h", "MTAtomic.h", "MTBag.h", "MTDisposable.h", "MTSubscriber.h", "MTSignal.h", "MTNetworkUsageCalculationInfo.h", "MTNetworkUsageManager.h", "MTBackupAddressSignals.h", "thirdparty/AFNetworking/AFURLConnectionOperation.h", "thirdparty/AFNetworking/AFHTTPRequestOperation.h", "MTProxyConnectivity.h", "MTGzip.h", "MTDatacenterVerificationData.h", "MTPKCS.h", "TON/TON.h", ], visibility = ["PUBLIC"], deps = [ ":openssl", ":ton", ], frameworks = [ "$SDKROOT/System/Library/Frameworks/Foundation.framework", "$SDKROOT/System/Library/Frameworks/Security.framework", ], )