mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-07 08:01:10 +00:00
Bazel
This commit is contained in:
parent
ba931407b3
commit
cd3ffe902e
15
.bazelrc
15
.bazelrc
@ -6,26 +6,11 @@ build --apple_crosstool_top=@local_config_apple_cc//:toolchain
|
|||||||
build --crosstool_top=@local_config_apple_cc//:toolchain
|
build --crosstool_top=@local_config_apple_cc//:toolchain
|
||||||
build --host_crosstool_top=@local_config_apple_cc//:toolchain
|
build --host_crosstool_top=@local_config_apple_cc//:toolchain
|
||||||
|
|
||||||
build --cxxopt='-std=c++17'
|
|
||||||
build --per_file_copt="third-party/webrtc/.*\.cpp$","@-std=c++17"
|
|
||||||
build --per_file_copt="third-party/webrtc/.*\.cc$","@-std=c++17"
|
|
||||||
build --per_file_copt="third-party/webrtc/.*\.mm$","@-std=c++17"
|
|
||||||
build --per_file_copt="submodules/LottieMeshSwift/LottieMeshBinding/Sources/.*\.mm$","@-std=c++17"
|
|
||||||
build --per_file_copt="submodules/LottieCpp/lottiecpp/Sources/.*\.mm$","@-std=c++17"
|
|
||||||
build --per_file_copt="submodules/LottieCpp/lottiecpp/Sources/.*\.cpp$","@-std=c++17"
|
|
||||||
build --per_file_copt="submodules/LottieCpp/lottiecpp/PlatformSpecific/Darwin/Sources/.*\.mm$","@-std=c++17"
|
|
||||||
build --per_file_copt="submodules/LottieCpp/lottiecpp/PlatformSpecific/Darwin/Sources/.*\.cpp$","@-std=c++17"
|
|
||||||
build --per_file_copt="Tests/LottieMetalTest/SoftwareLottieRenderer/Sources/.*\.cpp$","@-std=c++17"
|
|
||||||
build --per_file_copt="Tests/LottieMetalTest/SoftwareLottieRenderer/Sources/.*\.mm$","@-std=c++17"
|
|
||||||
build --per_file_copt="third-party/td/TdBinding/Sources/.*\.mm$","@-std=c++17"
|
|
||||||
|
|
||||||
#build --swiftcopt=-whole-module-optimization
|
#build --swiftcopt=-whole-module-optimization
|
||||||
|
|
||||||
build --per_file_copt=".*\.m$","@-fno-objc-msgsend-selector-stubs"
|
build --per_file_copt=".*\.m$","@-fno-objc-msgsend-selector-stubs"
|
||||||
build --per_file_copt=".*\.mm$","@-fno-objc-msgsend-selector-stubs"
|
build --per_file_copt=".*\.mm$","@-fno-objc-msgsend-selector-stubs"
|
||||||
|
|
||||||
#build --linkopt="-ld_classic"
|
|
||||||
|
|
||||||
build --features=debug_prefix_map_pwd_is_dot
|
build --features=debug_prefix_map_pwd_is_dot
|
||||||
build --features=swift.cacheable_swiftmodules
|
build --features=swift.cacheable_swiftmodules
|
||||||
build --features=swift.debug_prefix_map
|
build --features=swift.debug_prefix_map
|
||||||
|
@ -1779,16 +1779,13 @@ ios_application(
|
|||||||
":UrlTypesInfoPlist",
|
":UrlTypesInfoPlist",
|
||||||
],
|
],
|
||||||
deps = [
|
deps = [
|
||||||
#"//submodules/MtProtoKit",
|
"//submodules/Display",
|
||||||
#"//submodules/SSignalKit/SwiftSignalKit",
|
"//submodules/TelegramCore",
|
||||||
#"//submodules/Postbox",
|
"//submodules/FFMpegBinding",
|
||||||
#"//submodules/TelegramApi",
|
"//third-party/webrtc",
|
||||||
#"//submodules/TelegramCore",
|
|
||||||
#"//submodules/FFMpegBinding",
|
|
||||||
#"//submodules/Display",
|
|
||||||
#"//third-party/webrtc",
|
|
||||||
"//submodules/AsyncDisplayKit",
|
"//submodules/AsyncDisplayKit",
|
||||||
"//submodules/ObjCRuntimeUtils",
|
"//submodules/ObjCRuntimeUtils",
|
||||||
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -16,6 +16,11 @@ objc_library(
|
|||||||
"-Werror",
|
"-Werror",
|
||||||
"-I{}/Sources".format(package_name()),
|
"-I{}/Sources".format(package_name()),
|
||||||
],
|
],
|
||||||
|
cxxopts = [
|
||||||
|
"-Werror",
|
||||||
|
"-std=c++17",
|
||||||
|
"-I{}/Sources".format(package_name()),
|
||||||
|
],
|
||||||
hdrs = glob([
|
hdrs = glob([
|
||||||
"PublicHeaders/**/*.h",
|
"PublicHeaders/**/*.h",
|
||||||
]),
|
]),
|
||||||
|
@ -54,10 +54,14 @@ _IGNORE_CC_LIBRARY_EMPTY_ATTRS = [
|
|||||||
"include_prefix",
|
"include_prefix",
|
||||||
"strip_include_prefix",
|
"strip_include_prefix",
|
||||||
"local_defines",
|
"local_defines",
|
||||||
|
"conlyopts",
|
||||||
|
"module_interfaces",
|
||||||
|
"package_metadata",
|
||||||
]
|
]
|
||||||
|
|
||||||
_CC_LIBRARY_ATTRS = {
|
_CC_LIBRARY_ATTRS = {
|
||||||
"copts": [],
|
"copts": [],
|
||||||
|
"cxxopts": [],
|
||||||
"defines": [],
|
"defines": [],
|
||||||
"deps": [],
|
"deps": [],
|
||||||
"hdrs": [],
|
"hdrs": [],
|
||||||
@ -108,11 +112,11 @@ _IGNORE_OBJC_LIBRARY_EMPTY_ATTRS = [
|
|||||||
"textual_hdrs",
|
"textual_hdrs",
|
||||||
"sdk_includes",
|
"sdk_includes",
|
||||||
"conlyopts",
|
"conlyopts",
|
||||||
"cxxopts",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
_OBJC_LIBRARY_ATTRS = {
|
_OBJC_LIBRARY_ATTRS = {
|
||||||
"copts": [],
|
"copts": [],
|
||||||
|
"cxxopts": [],
|
||||||
"defines": [],
|
"defines": [],
|
||||||
"deps": [],
|
"deps": [],
|
||||||
"hdrs": [],
|
"hdrs": [],
|
||||||
@ -351,6 +355,7 @@ def _collect_spm_modules_impl(target, ctx):
|
|||||||
"sources": sorted(sources + headers),
|
"sources": sorted(sources + headers),
|
||||||
"module_name": module_name,
|
"module_name": module_name,
|
||||||
"copts": result_attrs["copts"],
|
"copts": result_attrs["copts"],
|
||||||
|
"cxxopts": result_attrs["cxxopts"],
|
||||||
"sdk_frameworks": result_attrs["sdk_frameworks"],
|
"sdk_frameworks": result_attrs["sdk_frameworks"],
|
||||||
"sdk_dylibs": result_attrs["sdk_dylibs"],
|
"sdk_dylibs": result_attrs["sdk_dylibs"],
|
||||||
"weak_sdk_frameworks": result_attrs["weak_sdk_frameworks"],
|
"weak_sdk_frameworks": result_attrs["weak_sdk_frameworks"],
|
||||||
@ -366,6 +371,7 @@ def _collect_spm_modules_impl(target, ctx):
|
|||||||
"sources": sorted(sources + headers),
|
"sources": sorted(sources + headers),
|
||||||
"module_name": module_name,
|
"module_name": module_name,
|
||||||
"copts": result_attrs["copts"],
|
"copts": result_attrs["copts"],
|
||||||
|
"cxxopts": result_attrs["cxxopts"],
|
||||||
"includes": result_attrs["includes"],
|
"includes": result_attrs["includes"],
|
||||||
}
|
}
|
||||||
elif module_type == "swift_library":
|
elif module_type == "swift_library":
|
||||||
@ -373,6 +379,7 @@ def _collect_spm_modules_impl(target, ctx):
|
|||||||
"name": result_attrs["name"],
|
"name": result_attrs["name"],
|
||||||
"type": module_type,
|
"type": module_type,
|
||||||
"path": module_path,
|
"path": module_path,
|
||||||
|
"defines": result_attrs["defines"],
|
||||||
"deps": dep_names,
|
"deps": dep_names,
|
||||||
"sources": sorted(sources),
|
"sources": sorted(sources),
|
||||||
"module_name": module_name,
|
"module_name": module_name,
|
||||||
|
@ -19,6 +19,24 @@ if os.path.exists(spm_files_dir):
|
|||||||
if not os.path.exists(spm_files_dir):
|
if not os.path.exists(spm_files_dir):
|
||||||
os.makedirs(spm_files_dir)
|
os.makedirs(spm_files_dir)
|
||||||
|
|
||||||
|
def escape_swift_string_literal_component(text: str) -> str:
|
||||||
|
return text.replace('\\', '\\\\').replace('"', '\\"')
|
||||||
|
|
||||||
|
parsed_modules = {}
|
||||||
|
for name, module in sorted(modules.items()):
|
||||||
|
is_empty = False
|
||||||
|
all_source_files = []
|
||||||
|
for source in module.get("hdrs", []) + module["sources"]:
|
||||||
|
if source.endswith(('.a')):
|
||||||
|
continue
|
||||||
|
all_source_files.append(source)
|
||||||
|
if module["type"] == "objc_library" or module["type"] == "swift_library" or module["type"] == "cc_library":
|
||||||
|
if all_source_files == []:
|
||||||
|
is_empty = True
|
||||||
|
parsed_modules[name] = {
|
||||||
|
"is_empty": is_empty,
|
||||||
|
}
|
||||||
|
|
||||||
combined_lines = []
|
combined_lines = []
|
||||||
combined_lines.append("// swift-tools-version: 6.0")
|
combined_lines.append("// swift-tools-version: 6.0")
|
||||||
combined_lines.append("// The swift-tools-version declares the minimum version of Swift required to build this package.")
|
combined_lines.append("// The swift-tools-version declares the minimum version of Swift required to build this package.")
|
||||||
@ -28,11 +46,14 @@ combined_lines.append("")
|
|||||||
combined_lines.append("let package = Package(")
|
combined_lines.append("let package = Package(")
|
||||||
combined_lines.append(" name: \"Telegram\",")
|
combined_lines.append(" name: \"Telegram\",")
|
||||||
combined_lines.append(" platforms: [")
|
combined_lines.append(" platforms: [")
|
||||||
combined_lines.append(" .iOS(.v13)")
|
combined_lines.append(" .iOS(.v12)")
|
||||||
combined_lines.append(" ],")
|
combined_lines.append(" ],")
|
||||||
combined_lines.append(" products: [")
|
combined_lines.append(" products: [")
|
||||||
|
|
||||||
for name, module in sorted(modules.items()):
|
for name, module in sorted(modules.items()):
|
||||||
|
if parsed_modules[name]["is_empty"]:
|
||||||
|
continue
|
||||||
|
|
||||||
if module["type"] == "objc_library" or module["type"] == "swift_library" or module["type"] == "cc_library":
|
if module["type"] == "objc_library" or module["type"] == "swift_library" or module["type"] == "cc_library":
|
||||||
combined_lines.append(" .library(name: \"%s\", targets: [\"%s\"])," % (module["name"], module["name"]))
|
combined_lines.append(" .library(name: \"%s\", targets: [\"%s\"])," % (module["name"], module["name"]))
|
||||||
|
|
||||||
@ -40,6 +61,9 @@ combined_lines.append(" ],")
|
|||||||
combined_lines.append(" targets: [")
|
combined_lines.append(" targets: [")
|
||||||
|
|
||||||
for name, module in sorted(modules.items()):
|
for name, module in sorted(modules.items()):
|
||||||
|
if parsed_modules[name]["is_empty"]:
|
||||||
|
continue
|
||||||
|
|
||||||
module_type = module["type"]
|
module_type = module["type"]
|
||||||
if module_type == "objc_library" or module_type == "cc_library" or module_type == "swift_library":
|
if module_type == "objc_library" or module_type == "cc_library" or module_type == "swift_library":
|
||||||
combined_lines.append(" .target(")
|
combined_lines.append(" .target(")
|
||||||
@ -47,7 +71,7 @@ for name, module in sorted(modules.items()):
|
|||||||
|
|
||||||
linked_directory = None
|
linked_directory = None
|
||||||
has_non_linked_sources = False
|
has_non_linked_sources = False
|
||||||
for source in module["sources"]:
|
for source in module["sources"] + module.get("hdrs", []):
|
||||||
if source.startswith("bazel-out/"):
|
if source.startswith("bazel-out/"):
|
||||||
linked_directory = "spm-files/" + name
|
linked_directory = "spm-files/" + name
|
||||||
else:
|
else:
|
||||||
@ -60,6 +84,7 @@ for name, module in sorted(modules.items()):
|
|||||||
|
|
||||||
combined_lines.append(" dependencies: [")
|
combined_lines.append(" dependencies: [")
|
||||||
for dep in module["deps"]:
|
for dep in module["deps"]:
|
||||||
|
if not parsed_modules[dep]["is_empty"]:
|
||||||
combined_lines.append(" .target(name: \"%s\")," % dep)
|
combined_lines.append(" .target(name: \"%s\")," % dep)
|
||||||
combined_lines.append(" ],")
|
combined_lines.append(" ],")
|
||||||
|
|
||||||
@ -85,7 +110,7 @@ for name, module in sorted(modules.items()):
|
|||||||
continue
|
continue
|
||||||
# Check if any source file is under this directory
|
# Check if any source file is under this directory
|
||||||
has_source = False
|
has_source = False
|
||||||
for source in module["sources"]:
|
for source in module["sources"] + module.get("hdrs", []):
|
||||||
rel_source = source[len(module["path"]) + 1:]
|
rel_source = source[len(module["path"]) + 1:]
|
||||||
if rel_source.startswith(dir_path + "/"):
|
if rel_source.startswith(dir_path + "/"):
|
||||||
has_source = True
|
has_source = True
|
||||||
@ -98,16 +123,14 @@ for name, module in sorted(modules.items()):
|
|||||||
file_path = os.path.join(rel_path, f)
|
file_path = os.path.join(rel_path, f)
|
||||||
if any(component.startswith('.') for component in file_path.split('/')):
|
if any(component.startswith('.') for component in file_path.split('/')):
|
||||||
continue
|
continue
|
||||||
if file_path not in [source[len(module["path"]) + 1:] for source in module["sources"]]:
|
if file_path not in [source[len(module["path"]) + 1:] for source in module["sources"] + module.get("hdrs", [])]:
|
||||||
exclude_files_and_dirs.append(file_path)
|
exclude_files_and_dirs.append(file_path)
|
||||||
for item in exclude_files_and_dirs:
|
for item in exclude_files_and_dirs:
|
||||||
combined_lines.append(" \"%s\"," % item)
|
combined_lines.append(" \"%s\"," % item)
|
||||||
combined_lines.append(" ],")
|
combined_lines.append(" ],")
|
||||||
|
|
||||||
combined_lines.append(" sources: [")
|
combined_lines.append(" sources: [")
|
||||||
for source in module["sources"]:
|
for source in module["sources"] + module.get("hdrs", []):
|
||||||
if source.endswith(('.h', '.hpp')):
|
|
||||||
continue
|
|
||||||
linked_source_file_names = []
|
linked_source_file_names = []
|
||||||
if not source.startswith(module["path"]):
|
if not source.startswith(module["path"]):
|
||||||
if source.startswith("bazel-out/"):
|
if source.startswith("bazel-out/"):
|
||||||
@ -138,6 +161,7 @@ for name, module in sorted(modules.items()):
|
|||||||
|
|
||||||
os.symlink(symlink_target, symlink_location)
|
os.symlink(symlink_target, symlink_location)
|
||||||
relative_source = source_file_name
|
relative_source = source_file_name
|
||||||
|
if not source.endswith(('.h', '.hpp', '.a')):
|
||||||
combined_lines.append(" \"%s\"," % relative_source)
|
combined_lines.append(" \"%s\"," % relative_source)
|
||||||
else:
|
else:
|
||||||
print("Source {} is not inside module path {}".format(source, module["path"]))
|
print("Source {} is not inside module path {}".format(source, module["path"]))
|
||||||
@ -152,16 +176,53 @@ for name, module in sorted(modules.items()):
|
|||||||
elif len(module["includes"]) == 1:
|
elif len(module["includes"]) == 1:
|
||||||
combined_lines.append(" publicHeadersPath: \"%s\"," % module["includes"][0])
|
combined_lines.append(" publicHeadersPath: \"%s\"," % module["includes"][0])
|
||||||
else:
|
else:
|
||||||
print("Multiple includes are not supported yet: {}".format(module["includes"]))
|
print("{}: Multiple includes are not yet supported: {}".format(name, module["includes"]))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
defines = module.get("defines", [])
|
||||||
|
copts = module.get("copts", [])
|
||||||
|
cxxopts = module.get("cxxopts", [])
|
||||||
|
|
||||||
|
if defines or copts:
|
||||||
combined_lines.append(" cSettings: [")
|
combined_lines.append(" cSettings: [")
|
||||||
|
if defines:
|
||||||
|
for define in defines:
|
||||||
|
if "=" in define:
|
||||||
|
print("{}: Defines with = are not yet supported: {}".format(name, define))
|
||||||
|
sys.exit(1)
|
||||||
|
else:
|
||||||
|
combined_lines.append(f' .define("{define}"),')
|
||||||
|
if copts:
|
||||||
combined_lines.append(" .unsafeFlags([")
|
combined_lines.append(" .unsafeFlags([")
|
||||||
for flag in module["copts"]:
|
for flag in copts:
|
||||||
# Escape C-string entities in flag
|
escaped_flag = escape_swift_string_literal_component(flag)
|
||||||
escaped_flag = flag.replace('\\', '\\\\').replace('"', '\\"')
|
combined_lines.append(f' "{escaped_flag}",')
|
||||||
combined_lines.append(" \"%s\"," % escaped_flag)
|
|
||||||
combined_lines.append(" ])")
|
combined_lines.append(" ])")
|
||||||
combined_lines.append(" ],")
|
combined_lines.append(" ],")
|
||||||
|
|
||||||
|
if defines or cxxopts: # Check for defines OR cxxopts
|
||||||
|
combined_lines.append(" cxxSettings: [")
|
||||||
|
if defines: # Add defines again if present, for C++ context
|
||||||
|
for define in defines:
|
||||||
|
if "=" in define:
|
||||||
|
print("{}: Defines with = are not yet supported: {}".format(name, define))
|
||||||
|
sys.exit(1)
|
||||||
|
else:
|
||||||
|
combined_lines.append(f' .define("{define}"),')
|
||||||
|
if cxxopts:
|
||||||
|
combined_lines.append(" .unsafeFlags([")
|
||||||
|
for flag in cxxopts:
|
||||||
|
if flag.startswith("-std="):
|
||||||
|
if flag != "-std=c++17":
|
||||||
|
print("{}: Unsupported C++ standard: {}".format(name, flag))
|
||||||
|
sys.exit(1)
|
||||||
|
else:
|
||||||
|
continue
|
||||||
|
escaped_flag = escape_swift_string_literal_component(flag)
|
||||||
|
combined_lines.append(f' "{escaped_flag}",')
|
||||||
|
combined_lines.append(" ])")
|
||||||
|
combined_lines.append(" ],")
|
||||||
|
|
||||||
combined_lines.append(" linkerSettings: [")
|
combined_lines.append(" linkerSettings: [")
|
||||||
if module_type == "objc_library":
|
if module_type == "objc_library":
|
||||||
for framework in module["sdk_frameworks"]:
|
for framework in module["sdk_frameworks"]:
|
||||||
@ -171,11 +232,32 @@ for name, module in sorted(modules.items()):
|
|||||||
combined_lines.append(" ]")
|
combined_lines.append(" ]")
|
||||||
|
|
||||||
elif module_type == "swift_library":
|
elif module_type == "swift_library":
|
||||||
|
defines = module.get("defines", [])
|
||||||
|
swift_copts = module.get("copts", []) # These are actual swiftc flags
|
||||||
|
|
||||||
|
# Handle cSettings for defines if they exist
|
||||||
|
if defines:
|
||||||
|
combined_lines.append(" cSettings: [")
|
||||||
|
for define in defines:
|
||||||
|
combined_lines.append(f' .define("{define}"),')
|
||||||
|
combined_lines.append(" ],")
|
||||||
|
|
||||||
|
# Handle swiftSettings
|
||||||
combined_lines.append(" swiftSettings: [")
|
combined_lines.append(" swiftSettings: [")
|
||||||
combined_lines.append(" .swiftLanguageMode(.v5),")
|
combined_lines.append(" .swiftLanguageMode(.v5),")
|
||||||
|
# Add defines to swiftSettings as simple .define("STRING") flags
|
||||||
|
if defines:
|
||||||
|
for define in defines:
|
||||||
|
# For Swift settings, the define is passed as a single string, e.g., "KEY=VALUE" or "FLAG"
|
||||||
|
escaped_define = escape_swift_string_literal_component(define) # Escape the whole define string
|
||||||
|
combined_lines.append(f' .define("{escaped_define}"),')
|
||||||
|
|
||||||
|
# Add copts (swiftc flags) to unsafeFlags in swiftSettings
|
||||||
|
if swift_copts:
|
||||||
combined_lines.append(" .unsafeFlags([")
|
combined_lines.append(" .unsafeFlags([")
|
||||||
for flag in module["copts"]:
|
for flag in swift_copts:
|
||||||
combined_lines.append(" \"%s\"," % flag)
|
escaped_flag = escape_swift_string_literal_component(flag)
|
||||||
|
combined_lines.append(f' "{escaped_flag}",')
|
||||||
combined_lines.append(" ])")
|
combined_lines.append(" ])")
|
||||||
combined_lines.append(" ]")
|
combined_lines.append(" ]")
|
||||||
combined_lines.append(" ),")
|
combined_lines.append(" ),")
|
||||||
@ -185,7 +267,8 @@ for name, module in sorted(modules.items()):
|
|||||||
print("Unknown module type: {}".format(module["type"]))
|
print("Unknown module type: {}".format(module["type"]))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
combined_lines.append(" ]")
|
combined_lines.append(" ],")
|
||||||
|
combined_lines.append(" cxxLanguageStandard: .cxx17")
|
||||||
combined_lines.append(")")
|
combined_lines.append(")")
|
||||||
combined_lines.append("")
|
combined_lines.append("")
|
||||||
|
|
||||||
|
4
submodules/AsyncDisplayKit/BUILD
vendored
4
submodules/AsyncDisplayKit/BUILD
vendored
@ -17,6 +17,10 @@ objc_library(
|
|||||||
copts = [
|
copts = [
|
||||||
"-Werror",
|
"-Werror",
|
||||||
],
|
],
|
||||||
|
cxxopts = [
|
||||||
|
"-Werror",
|
||||||
|
"-std=c++17",
|
||||||
|
],
|
||||||
hdrs = public_headers,
|
hdrs = public_headers,
|
||||||
defines = [
|
defines = [
|
||||||
"MINIMAL_ASDK",
|
"MINIMAL_ASDK",
|
||||||
|
@ -63,3 +63,9 @@
|
|||||||
#import <AsyncDisplayKit/UIResponder+AsyncDisplayKit.h>
|
#import <AsyncDisplayKit/UIResponder+AsyncDisplayKit.h>
|
||||||
|
|
||||||
#import <AsyncDisplayKit/_ASCoreAnimationExtras.h>
|
#import <AsyncDisplayKit/_ASCoreAnimationExtras.h>
|
||||||
|
|
||||||
|
#import <AsyncDisplayKit/_ASTransitionContext.h>
|
||||||
|
#import <AsyncDisplayKit/ASInternalHelpers.h>
|
||||||
|
#import <AsyncDisplayKit/ASCGImageBuffer.h>
|
||||||
|
#import <AsyncDisplayKit/ASControlTargetAction.h>
|
||||||
|
#import <AsyncDisplayKit/ASDisplayNode+FrameworkPrivate.h>
|
||||||
|
@ -22,6 +22,11 @@ objc_library(
|
|||||||
"-Werror",
|
"-Werror",
|
||||||
"-I{}/lottiecpp/Sources".format(package_name()),
|
"-I{}/lottiecpp/Sources".format(package_name()),
|
||||||
],
|
],
|
||||||
|
cxxopts = [
|
||||||
|
"-Werror",
|
||||||
|
"-std=c++17",
|
||||||
|
"-I{}/lottiecpp/Sources".format(package_name()),
|
||||||
|
],
|
||||||
hdrs = glob([
|
hdrs = glob([
|
||||||
"lottiecpp/PublicHeaders/**/*.h",
|
"lottiecpp/PublicHeaders/**/*.h",
|
||||||
]),
|
]),
|
||||||
@ -49,6 +54,9 @@ cc_library(
|
|||||||
"PublicHeaders",
|
"PublicHeaders",
|
||||||
],
|
],
|
||||||
copts = [],
|
copts = [],
|
||||||
|
cxxopts = [
|
||||||
|
"-std=c++17",
|
||||||
|
],
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
linkstatic = 1,
|
linkstatic = 1,
|
||||||
)
|
)
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NSInteger providerIndex = -1;
|
__unused NSInteger providerIndex = -1;
|
||||||
for (NSItemProvider *provider in providers)
|
for (NSItemProvider *provider in providers)
|
||||||
{
|
{
|
||||||
providerIndex++;
|
providerIndex++;
|
||||||
@ -140,7 +140,7 @@
|
|||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
static UIImage *TGScaleImageToPixelSize(UIImage *image, CGSize size) {
|
__unused static UIImage *TGScaleImageToPixelSize(UIImage *image, CGSize size) {
|
||||||
UIGraphicsBeginImageContextWithOptions(size, true, 1.0f);
|
UIGraphicsBeginImageContextWithOptions(size, true, 1.0f);
|
||||||
[image drawInRect:CGRectMake(0, 0, size.width, size.height) blendMode:kCGBlendModeCopy alpha:1.0f];
|
[image drawInRect:CGRectMake(0, 0, size.width, size.height) blendMode:kCGBlendModeCopy alpha:1.0f];
|
||||||
UIImage *result = UIGraphicsGetImageFromCurrentImageContext();
|
UIImage *result = UIGraphicsGetImageFromCurrentImageContext();
|
||||||
@ -149,7 +149,7 @@ static UIImage *TGScaleImageToPixelSize(UIImage *image, CGSize size) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static CGSize TGFitSize(CGSize size, CGSize maxSize) {
|
__unused static CGSize TGFitSize(CGSize size, CGSize maxSize) {
|
||||||
if (size.width < 1)
|
if (size.width < 1)
|
||||||
size.width = 1;
|
size.width = 1;
|
||||||
if (size.height < 1)
|
if (size.height < 1)
|
||||||
|
@ -64,12 +64,15 @@ NSString *const TGShareGoogleProvider = @"google";
|
|||||||
|
|
||||||
NSString * TGURLEncodedStringFromStringWithEncoding(NSString *string, NSStringEncoding encoding) {
|
NSString * TGURLEncodedStringFromStringWithEncoding(NSString *string, NSStringEncoding encoding) {
|
||||||
static NSString * const kAFLegalCharactersToBeEscaped = @"?!@#$^&%*+=,:;'\"`<>()[]{}/\\|~ ";
|
static NSString * const kAFLegalCharactersToBeEscaped = @"?!@#$^&%*+=,:;'\"`<>()[]{}/\\|~ ";
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||||
NSString *unescapedString = [string stringByReplacingPercentEscapesUsingEncoding:encoding];
|
NSString *unescapedString = [string stringByReplacingPercentEscapesUsingEncoding:encoding];
|
||||||
if (unescapedString) {
|
if (unescapedString) {
|
||||||
string = unescapedString;
|
string = unescapedString;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (__bridge NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (__bridge CFStringRef)string, NULL, (__bridge CFStringRef)kAFLegalCharactersToBeEscaped, CFStringConvertNSStringEncodingToEncoding(encoding));
|
return (__bridge NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (__bridge CFStringRef)string, NULL, (__bridge CFStringRef)kAFLegalCharactersToBeEscaped, CFStringConvertNSStringEncodingToEncoding(encoding));
|
||||||
|
#pragma clang diagnostic pop
|
||||||
}
|
}
|
||||||
|
|
||||||
@implementation TGQueryStringComponent
|
@implementation TGQueryStringComponent
|
||||||
|
7
submodules/ffmpeg/BUILD
vendored
7
submodules/ffmpeg/BUILD
vendored
@ -286,11 +286,15 @@ genrule(
|
|||||||
PATH="$$PATH:$$YASM_DIR" "$$SOURCE_PATH/build-ffmpeg-bazel.sh" "$$VARIANT" "$$BUILD_ARCH" "$$BUILD_DIR" "$$SOURCE_PATH" "$$FFMPEG_VERSION"
|
PATH="$$PATH:$$YASM_DIR" "$$SOURCE_PATH/build-ffmpeg-bazel.sh" "$$VARIANT" "$$BUILD_ARCH" "$$BUILD_DIR" "$$SOURCE_PATH" "$$FFMPEG_VERSION"
|
||||||
""" + "\n" + "\n".join([
|
""" + "\n" + "\n".join([
|
||||||
"cp \"$$BUILD_DIR/FFmpeg-iOS/include/{header_path}\" \"$(location Public/third_party/ffmpeg/{header_path})\"".format(header_path = header_path) for header_path in ffmpeg_header_paths
|
"cp \"$$BUILD_DIR/FFmpeg-iOS/include/{header_path}\" \"$(location Public/third_party/ffmpeg/{header_path})\"".format(header_path = header_path) for header_path in ffmpeg_header_paths
|
||||||
|
]) + "\n" + "\n".join([
|
||||||
|
"cp \"$$BUILD_DIR/FFmpeg-iOS/include/{header_path}\" \"$(location Public/{header_path})\"".format(header_path = header_path) for header_path in ffmpeg_header_paths
|
||||||
]) + "\n" + "\n".join([
|
]) + "\n" + "\n".join([
|
||||||
"cp \"$$BUILD_DIR/FFmpeg-iOS/lib/{lib}\" \"$(location {lib})\"".format(lib = lib) for lib in ffmpeg_libs
|
"cp \"$$BUILD_DIR/FFmpeg-iOS/lib/{lib}\" \"$(location {lib})\"".format(lib = lib) for lib in ffmpeg_libs
|
||||||
]),
|
]),
|
||||||
outs = [
|
outs = [
|
||||||
"Public/third_party/ffmpeg/{}".format(header_path) for header_path in ffmpeg_header_paths
|
"Public/third_party/ffmpeg/{}".format(header_path) for header_path in ffmpeg_header_paths
|
||||||
|
] + [
|
||||||
|
"Public/{}".format(header_path) for header_path in ffmpeg_header_paths
|
||||||
] + ffmpeg_libs,
|
] + ffmpeg_libs,
|
||||||
tools = [
|
tools = [
|
||||||
"//third-party/yasm:yasm.tar",
|
"//third-party/yasm:yasm.tar",
|
||||||
@ -312,10 +316,9 @@ objc_library(
|
|||||||
name = "ffmpeg",
|
name = "ffmpeg",
|
||||||
module_name = "ffmpeg",
|
module_name = "ffmpeg",
|
||||||
enable_modules = True,
|
enable_modules = True,
|
||||||
hdrs = ["Public/third_party/ffmpeg/" + x for x in ffmpeg_header_paths],
|
hdrs = ["Public/third_party/ffmpeg/" + x for x in ffmpeg_header_paths] + ["Public/" + x for x in ffmpeg_header_paths],
|
||||||
includes = [
|
includes = [
|
||||||
"Public",
|
"Public",
|
||||||
"Public/third_party/ffmpeg",
|
|
||||||
],
|
],
|
||||||
sdk_dylibs = [
|
sdk_dylibs = [
|
||||||
"libbz2",
|
"libbz2",
|
||||||
|
@ -162,6 +162,9 @@ genrule(
|
|||||||
cc_library(
|
cc_library(
|
||||||
name = "openssl_lib",
|
name = "openssl_lib",
|
||||||
srcs = [":" + x for x in openssl_libs],
|
srcs = [":" + x for x in openssl_libs],
|
||||||
|
cxxopts = [
|
||||||
|
"-std=c++17",
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
objc_library(
|
objc_library(
|
||||||
|
1
submodules/sqlcipher/BUILD
vendored
1
submodules/sqlcipher/BUILD
vendored
@ -29,6 +29,7 @@ objc_library(
|
|||||||
"-DNDEBUG=1",
|
"-DNDEBUG=1",
|
||||||
"-DSQLITE_MAX_MMAP_SIZE=0",
|
"-DSQLITE_MAX_MMAP_SIZE=0",
|
||||||
"-Wno-all",
|
"-Wno-all",
|
||||||
|
"-Wno-#warnings",
|
||||||
],
|
],
|
||||||
sdk_frameworks = [
|
sdk_frameworks = [
|
||||||
"Foundation",
|
"Foundation",
|
||||||
|
4
third-party/td/BUILD
vendored
4
third-party/td/BUILD
vendored
@ -135,6 +135,10 @@ objc_library(
|
|||||||
copts = [
|
copts = [
|
||||||
"-Werror",
|
"-Werror",
|
||||||
],
|
],
|
||||||
|
cxxopts = [
|
||||||
|
"-Werror",
|
||||||
|
"-std=c++17",
|
||||||
|
],
|
||||||
includes = [
|
includes = [
|
||||||
"TdBinding/Public",
|
"TdBinding/Public",
|
||||||
],
|
],
|
||||||
|
6
third-party/webrtc/BUILD
vendored
6
third-party/webrtc/BUILD
vendored
@ -3473,6 +3473,9 @@ cc_library(
|
|||||||
"-DWEBRTC_HAVE_DCSCTP",
|
"-DWEBRTC_HAVE_DCSCTP",
|
||||||
"-DWEBRTC_HAVE_SCTP",
|
"-DWEBRTC_HAVE_SCTP",
|
||||||
] + arch_specific_cflags + optimization_flags,
|
] + arch_specific_cflags + optimization_flags,
|
||||||
|
cxxopts = [
|
||||||
|
"-std=c++17",
|
||||||
|
],
|
||||||
deps = [
|
deps = [
|
||||||
"//third-party/boringssl:crypto",
|
"//third-party/boringssl:crypto",
|
||||||
"//third-party/boringssl:ssl",
|
"//third-party/boringssl:ssl",
|
||||||
@ -3602,6 +3605,9 @@ objc_library(
|
|||||||
"-DRTC_DISABLE_TRACE_EVENTS",
|
"-DRTC_DISABLE_TRACE_EVENTS",
|
||||||
"-DRTC_DISABLE_METRICS",
|
"-DRTC_DISABLE_METRICS",
|
||||||
] + arch_specific_cflags + optimization_flags,
|
] + arch_specific_cflags + optimization_flags,
|
||||||
|
cxxopts = [
|
||||||
|
"-std=c++17",
|
||||||
|
],
|
||||||
deps = [
|
deps = [
|
||||||
"//third-party/boringssl:crypto",
|
"//third-party/boringssl:crypto",
|
||||||
"//third-party/boringssl:ssl",
|
"//third-party/boringssl:ssl",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user