2019-09-17 22:51:03 +04:00

170 lines
4.5 KiB
Python

load("//Config:buck_rule_macros.bzl", "static_library", "framework")
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",
"fift",
"keys",
"memprof",
"tdactor",
"tddb",
"tdnet",
"tdtl",
"tdutils",
"terminal",
"tl-lite-utils",
"tl-utils",
"tl_api",
"tl_lite_api",
"tl_tonlib_api",
"tl_tonlib_api_json",
"ton_block",
"ton_crypto",
"ton_db",
"tonlib",
"tonlibjson_private",
"tonlibjson_static",
]
ton_lib_flags = ["-l" + name for name in ton_lib_names]
genrule(
name = "ton_libs",
srcs = glob([
"TON/*.a",
]),
bash = "mkdir -p $OUT; cp $SRCS $OUT/",
out = "ton_libs",
visibility = ["PUBLIC"]
)
apple_library(
name = "ton",
visibility = [
"//submodules/MtProtoKit:MtProtoKit"
],
header_namespace = "ton",
exported_headers = glob([
"TON/include/*.h",
]),
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 = glob([
"*.h",
"MtProtoKit/*.h",
"thirdparty/AFNetworking/*.h",
"thirdparty/AsyncSocket/*.h",
"TON/*.h",
"TON/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",
],
)