mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-06 17:00:13 +00:00
Fix build
This commit is contained in:
parent
e3d3922fbc
commit
0be79b443f
@ -1,14 +1,14 @@
|
|||||||
[cxx]
|
[cxx]
|
||||||
default_platform = iphonesimulator-x86_64
|
default_platform = iphonesimulator-x86_64
|
||||||
cflags = -g -fmodules -fobjc-arc -D BUCK -w $(config custom.other_cflags)
|
cflags = -g -fmodules -fobjc-arc -D BUCK -D DEBUG -w $(config custom.other_cflags)
|
||||||
cxxflags = -fobjc-arc -std=c++14 -D DEBUG -g $(config custom.other_cxxflags)
|
cxxflags = -fobjc-arc -std=c++14 -D BUCK -D DEBUG -g $(config custom.other_cxxflags)
|
||||||
combined_preprocess_and_compile = true
|
combined_preprocess_and_compile = true
|
||||||
pch_enabled = false
|
pch_enabled = false
|
||||||
ldflags = -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime $(config custom.other_cxxflags)
|
ldflags = -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime $(config custom.other_cxxflags)
|
||||||
|
|
||||||
[swift]
|
[swift]
|
||||||
version = 4.0
|
version = 4.0
|
||||||
compiler_flags = -DBUCK -enable-testing -g -Onone $(config custom.other_swift_compiler_flags)
|
compiler_flags = -DBUCK -enable-testing -enable-batch-mode -g -Onone $(config custom.other_swift_compiler_flags)
|
||||||
use_filelist = true
|
use_filelist = true
|
||||||
|
|
||||||
[apple]
|
[apple]
|
||||||
|
|||||||
2
.gitmodules
vendored
2
.gitmodules
vendored
@ -9,7 +9,7 @@ url=../Display.git
|
|||||||
url=../HockeySDK-iOS.git
|
url=../HockeySDK-iOS.git
|
||||||
[submodule "submodules/libtgvoip"]
|
[submodule "submodules/libtgvoip"]
|
||||||
path = submodules/libtgvoip
|
path = submodules/libtgvoip
|
||||||
url=https://github.com/grishka/libtgvoip.git
|
url=../libtgvoip.git
|
||||||
[submodule "submodules/lottie-ios"]
|
[submodule "submodules/lottie-ios"]
|
||||||
path = submodules/lottie-ios
|
path = submodules/lottie-ios
|
||||||
url=../lottie-ios.git
|
url=../lottie-ios.git
|
||||||
|
|||||||
4
BUCK
4
BUCK
@ -51,6 +51,10 @@ apple_binary(
|
|||||||
'//submodules/HockeySDK-iOS:HockeySDK',
|
'//submodules/HockeySDK-iOS:HockeySDK',
|
||||||
'//submodules/lottie-ios:Lottie',
|
'//submodules/lottie-ios:Lottie',
|
||||||
'//submodules/libtgvoip:tgvoip',
|
'//submodules/libtgvoip:tgvoip',
|
||||||
|
'//submodules/webp:WebP',
|
||||||
|
'//submodules/ffmpeg:FFMpeg',
|
||||||
|
'//submodules/TelegramUI:TelegramUI',
|
||||||
|
'//submodules/TelegramUI:TelegramUIPrivateModule',
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
#if BUCK
|
||||||
|
import MtProtoKit
|
||||||
|
#else
|
||||||
import MtProtoKitDynamic
|
import MtProtoKitDynamic
|
||||||
|
#endif
|
||||||
|
|
||||||
struct ImageResource {
|
struct ImageResource {
|
||||||
let datacenterId: Int
|
let datacenterId: Int
|
||||||
|
|||||||
@ -1,6 +1,10 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import UserNotifications
|
import UserNotifications
|
||||||
|
#if BUCK
|
||||||
|
import MtProtoKit
|
||||||
|
#else
|
||||||
import MtProtoKitDynamic
|
import MtProtoKitDynamic
|
||||||
|
#endif
|
||||||
import WebP
|
import WebP
|
||||||
|
|
||||||
private var sharedLogger: Logger?
|
private var sharedLogger: Logger?
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
#if BUCK
|
||||||
|
import MtProtoKit
|
||||||
|
#else
|
||||||
import MtProtoKitDynamic
|
import MtProtoKitDynamic
|
||||||
|
#endif
|
||||||
|
|
||||||
public class BoxedMessage: NSObject {
|
public class BoxedMessage: NSObject {
|
||||||
public let body: Any
|
public let body: Any
|
||||||
|
|||||||
@ -2,7 +2,11 @@ import Foundation
|
|||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
import Postbox
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
|
#if BUCK
|
||||||
|
import MtProtoKit
|
||||||
|
#else
|
||||||
import MtProtoKitDynamic
|
import MtProtoKitDynamic
|
||||||
|
#endif
|
||||||
import Display
|
import Display
|
||||||
import TelegramUI
|
import TelegramUI
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,11 @@ import Foundation
|
|||||||
import TelegramCore
|
import TelegramCore
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
import Postbox
|
||||||
|
#if BUCK
|
||||||
|
import MtProtoKit
|
||||||
|
#else
|
||||||
import MtProtoKitDynamic
|
import MtProtoKitDynamic
|
||||||
|
#endif
|
||||||
|
|
||||||
enum AccountImportError: Error {
|
enum AccountImportError: Error {
|
||||||
case generic
|
case generic
|
||||||
|
|||||||
@ -2,7 +2,11 @@ import Foundation
|
|||||||
import TelegramCore
|
import TelegramCore
|
||||||
import SwiftSignalKit
|
import SwiftSignalKit
|
||||||
import Postbox
|
import Postbox
|
||||||
|
#if BUCK
|
||||||
|
import MtProtoKit
|
||||||
|
#else
|
||||||
import MtProtoKitDynamic
|
import MtProtoKitDynamic
|
||||||
|
#endif
|
||||||
import TelegramUI
|
import TelegramUI
|
||||||
|
|
||||||
import LegacyComponents
|
import LegacyComponents
|
||||||
|
|||||||
@ -9,6 +9,9 @@ import TelegramCore
|
|||||||
import LegacyComponents
|
import LegacyComponents
|
||||||
import HockeySDK
|
import HockeySDK
|
||||||
import Lottie
|
import Lottie
|
||||||
|
import WebP
|
||||||
|
import FFMpeg
|
||||||
|
import TelegramUIPrivateModule
|
||||||
|
|
||||||
func test() {
|
func test() {
|
||||||
let _ = ASDisplayNode()
|
let _ = ASDisplayNode()
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Subproject commit a9e374131912f68bb599f6c87b9da26a3687513e
|
Subproject commit 4fe76fd53bb0b561fde9aad5e32bd4d0ddca305c
|
||||||
@ -1 +1 @@
|
|||||||
Subproject commit a56806593c21485c474f1077feb588dfd2adc4a9
|
Subproject commit 242ad146b04051d6ff4ec5300d4c63dc457e5d8e
|
||||||
@ -1 +1 @@
|
|||||||
Subproject commit 33a1ee7e9ee60a7393ef58a3103cc6bce213bfe4
|
Subproject commit 36e789c8847a62fd9c369aa0a86376b0d6178893
|
||||||
@ -1 +1 @@
|
|||||||
Subproject commit 0495e4606b6a109f951f963c95b3d57ed5e031ff
|
Subproject commit 66818a3563789f475899ad9dd2e3c88e6af82895
|
||||||
@ -1 +1 @@
|
|||||||
Subproject commit 16711e202393ae7e1b160436f4291c5f06a3d375
|
Subproject commit a1ddd03c71fd318a3c81820c431a0a5e6563f9d4
|
||||||
@ -29,69 +29,80 @@ def configs_with_config(config):
|
|||||||
"Release": config,
|
"Release": config,
|
||||||
}
|
}
|
||||||
|
|
||||||
def subdir_glob(glob_specs, exclude = None, prefix = ""):
|
def merge_maps(dicts):
|
||||||
"""Returns a dict of sub-directory relative paths to full paths.
|
result = dict()
|
||||||
|
for d in dicts:
|
||||||
The subdir_glob() function is useful for defining header maps for C/C++
|
for key in d:
|
||||||
libraries which should be relative the given sub-directory.
|
if key in result and result[key] != d[key]:
|
||||||
Given a list of tuples, the form of (relative-sub-directory, glob-pattern),
|
|
||||||
it returns a dict of sub-directory relative paths to full paths.
|
|
||||||
|
|
||||||
Please refer to native.glob() for explanations and examples of the pattern.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
glob_specs: The array of tuples in form of
|
|
||||||
(relative-sub-directory, glob-pattern inside relative-sub-directory).
|
|
||||||
type: List[Tuple[str, str]]
|
|
||||||
exclude: A list of patterns to identify files that should be removed
|
|
||||||
from the set specified by the first argument. Defaults to [].
|
|
||||||
type: Optional[List[str]]
|
|
||||||
prefix: If is not None, prepends it to each key in the dictionary.
|
|
||||||
Defaults to None.
|
|
||||||
type: Optional[str]
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
A dict of sub-directory relative paths to full paths.
|
|
||||||
"""
|
|
||||||
if exclude == None:
|
|
||||||
exclude = []
|
|
||||||
|
|
||||||
results = []
|
|
||||||
|
|
||||||
for dirpath, glob_pattern in glob_specs:
|
|
||||||
results.append(
|
|
||||||
_single_subdir_glob(dirpath, glob_pattern, exclude, prefix),
|
|
||||||
)
|
|
||||||
|
|
||||||
return _merge_maps(*results)
|
|
||||||
|
|
||||||
def _merge_maps(*file_maps):
|
|
||||||
result = {}
|
|
||||||
for file_map in file_maps:
|
|
||||||
for key in file_map:
|
|
||||||
if key in result and result[key] != file_map[key]:
|
|
||||||
fail(
|
fail(
|
||||||
"Conflicting files in file search paths. " +
|
"Conflicting files in file search paths. " +
|
||||||
"\"%s\" maps to both \"%s\" and \"%s\"." %
|
"\"%s\" maps to both \"%s\" and \"%s\"." %
|
||||||
(key, result[key], file_map[key]),
|
(key, result[key], d[key]),
|
||||||
)
|
)
|
||||||
|
result.update(d)
|
||||||
result[key] = file_map[key]
|
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def _single_subdir_glob(dirpath, glob_pattern, exclude = None, prefix = None):
|
def basename(p):
|
||||||
if exclude == None:
|
"""Returns the basename (i.e., the file portion) of a path.
|
||||||
exclude = []
|
Note that if `p` ends with a slash, this function returns an empty string.
|
||||||
results = {}
|
This matches the behavior of Python's `os.path.basename`, but differs from
|
||||||
files = native.glob([dirpath + '/' + glob_pattern], exclude = exclude)
|
the Unix `basename` command (which would return the path segment preceding
|
||||||
for f in files:
|
the final slash).
|
||||||
if dirpath:
|
Args:
|
||||||
key = f[len(dirpath) + 1:]
|
p: The path whose basename should be returned.
|
||||||
else:
|
Returns:
|
||||||
key = f
|
The basename of the path, which includes the extension.
|
||||||
if prefix:
|
"""
|
||||||
key =prefix + '/' + key
|
return p.rpartition("/")[-1]
|
||||||
results[key] = f
|
|
||||||
|
|
||||||
return results
|
def glob_map(glob_results):
|
||||||
|
result = dict()
|
||||||
|
for path in glob_results:
|
||||||
|
file_name = basename(path)
|
||||||
|
if file_name in result:
|
||||||
|
fail('\"%s\" maps to both \"%s\" and \"%s\"' % (file_name, result[file_name], path))
|
||||||
|
result[file_name] = path
|
||||||
|
return result
|
||||||
|
|
||||||
|
def glob_sub_map(prefix, glob_specs):
|
||||||
|
result = dict()
|
||||||
|
for path in native.glob(glob_specs):
|
||||||
|
if not path.startswith(prefix):
|
||||||
|
fail('\"%s\" does not start with \"%s\"' % (path, prefix))
|
||||||
|
file_key = path[len(prefix):]
|
||||||
|
if file_key in result:
|
||||||
|
fail('\"%s\" maps to both \"%s\" and \"%s\"' % (file_key, result[file_key], path))
|
||||||
|
result[file_key] = path
|
||||||
|
return result
|
||||||
|
|
||||||
|
def gen_header_targets(header_paths, prefix, source_rule, source_path):
|
||||||
|
result = dict()
|
||||||
|
for header_path in header_paths:
|
||||||
|
name = prefix + header_path.replace('/', '_sub_')
|
||||||
|
native.genrule(
|
||||||
|
name = name,
|
||||||
|
cmd = 'cp $(location :' + source_rule + ')/' + source_path + '/' + header_path + ' $OUT',
|
||||||
|
out = name,
|
||||||
|
)
|
||||||
|
result[header_path] = ':' + name
|
||||||
|
return result
|
||||||
|
|
||||||
|
def lib_basename(name):
|
||||||
|
result = name
|
||||||
|
if result.startswith('lib'):
|
||||||
|
result = result[3:]
|
||||||
|
if result.endswith('.a'):
|
||||||
|
result = result[:-2]
|
||||||
|
return result
|
||||||
|
|
||||||
|
def gen_lib_targets(lib_paths, prefix, source_rule, source_path):
|
||||||
|
result = []
|
||||||
|
for lib_path in lib_paths:
|
||||||
|
name = lib_path.replace('/', '_sub_')
|
||||||
|
native.genrule(
|
||||||
|
name = name,
|
||||||
|
cmd = 'cp $(location :' + source_rule + ')/' + source_path + '/' + lib_path + ' $OUT',
|
||||||
|
out = name
|
||||||
|
)
|
||||||
|
result.append(name)
|
||||||
|
return result
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user