mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix buck build
This commit is contained in:
parent
9eee3f16ac
commit
4a8cc881e6
45
third-party/mozjpeg/BUCK
vendored
45
third-party/mozjpeg/BUCK
vendored
@ -1,8 +1,10 @@
|
||||
load("//Config:buck_rule_macros.bzl", "static_library", "gen_header_targets", "merge_maps")
|
||||
|
||||
headers = [
|
||||
"turbojpeg.h",
|
||||
"jpeglib.h",
|
||||
"jmorecfg.h",
|
||||
"mozjpeg/turbojpeg.h",
|
||||
"mozjpeg/jpeglib.h",
|
||||
"mozjpeg/jmorecfg.h",
|
||||
"mozjpeg/jconfig.h",
|
||||
]
|
||||
|
||||
libs = [
|
||||
@ -18,7 +20,6 @@ genrule(
|
||||
"build-mozjpeg-buck.sh",
|
||||
],
|
||||
bash =
|
||||
cmd_bash =
|
||||
"""
|
||||
set -ex
|
||||
|
||||
@ -26,21 +27,31 @@ cmd_bash =
|
||||
|
||||
mkdir -p "$OUT"
|
||||
|
||||
BUILD_DIR="$(OUT)/build_$${BUILD_ARCH}"
|
||||
BUILD_DIR="$OUT/$BUILD_ARCH"
|
||||
rm -rf "$BUILD_DIR"
|
||||
mkdir -p "$BUILD_DIR"
|
||||
|
||||
CMAKE_DIR="$(location //third-party/cmake:cmake)/cmake-3.16.0"
|
||||
|
||||
cp $(location :build-mozjpeg-buck.sh) "$BUILD_DIR/"
|
||||
|
||||
SOURCE_PATH="third-party/mozjpeg/mozjpeg"
|
||||
cp "$SRCDIR/build-mozjpeg-buck.sh" "$BUILD_DIR/"
|
||||
|
||||
cp -R "$SRCDIR/mozjpeg" "$BUILD_DIR/"
|
||||
|
||||
mkdir -p "$BUILD_DIR/Public/mozjpeg"
|
||||
|
||||
PATH="$PATH:$CMAKE_DIR/bin" sh $BUILD_DIR/build-mozjpeg-bazel.sh $BUILD_ARCH "$BUILD_DIR/mozjpeg" "$BUILD_DIR"
|
||||
PATH="$PATH:$CMAKE_DIR/bin" sh $BUILD_DIR/build-mozjpeg-buck.sh $BUILD_ARCH "$BUILD_DIR/mozjpeg" "$BUILD_DIR"
|
||||
|
||||
mkdir -p $OUT/Public/mozjpeg
|
||||
mkdir -p $OUT/Public/lib
|
||||
|
||||
cp $BUILD_DIR/mozjpeg/turbojpeg.h "$OUT/Public/mozjpeg/"
|
||||
cp $BUILD_DIR/mozjpeg/jpeglib.h "$OUT/Public/mozjpeg/"
|
||||
cp $BUILD_DIR/mozjpeg/jmorecfg.h "$OUT/Public/mozjpeg/"
|
||||
cp $BUILD_DIR/build/jconfig.h "$OUT/Public/mozjpeg/"
|
||||
|
||||
cp $BUILD_DIR/build/libjpeg.a "$OUT/Public/lib/"
|
||||
cp $BUILD_DIR/build/libturbojpeg.a "$OUT/Public/lib/"
|
||||
|
||||
""",
|
||||
out = "libmozjpeg",
|
||||
visibility = [
|
||||
@ -48,20 +59,22 @@ cmd_bash =
|
||||
]
|
||||
)
|
||||
|
||||
mozjpeg_header_targets = gen_header_targets(headers, "libmozjpeg_header_", "", "libmozjpeg_build", "Public")
|
||||
|
||||
apple_library(
|
||||
name = "mozjpeg_lib",
|
||||
exported_headers = mozjpeg_header_targets,
|
||||
visibility = [
|
||||
"//third-party/mozjpeg:mozjpeg"
|
||||
],
|
||||
header_namespace = "ffmpeg",
|
||||
exported_headers = ffmpeg_header_targets,
|
||||
header_namespace = "mozjpeg",
|
||||
linker_flags = [
|
||||
"-L$(location :libmozjpeg_build)/lib",
|
||||
"-L$(location :libmozjpeg_build)/Public/lib",
|
||||
"-ljpeg",
|
||||
"-lturbojpeg",
|
||||
],
|
||||
exported_linker_flags = [
|
||||
"-L$(location :libmozjpeg_build)/lib",
|
||||
"-L$(location :libmozjpeg_build)/Public/lib",
|
||||
"-ljpeg",
|
||||
"-lturbojpeg",
|
||||
],
|
||||
@ -70,13 +83,9 @@ apple_library(
|
||||
],
|
||||
)
|
||||
|
||||
mozjpeg_header_targets = gen_header_targets(headers, "libmozjpeg_header_", "", "libmozjpeg_build", "mozjpeg/include")
|
||||
|
||||
static_library(
|
||||
name = "mozjpeg",
|
||||
exported_headers = merge_maps([
|
||||
mozjpeg_header_targets,
|
||||
]),
|
||||
exported_headers = mozjpeg_header_targets,
|
||||
deps = [
|
||||
":libmozjpeg_build",
|
||||
":mozjpeg_lib",
|
||||
|
Loading…
x
Reference in New Issue
Block a user