Skip to content

Commit a62b814

Browse files
committed
add libyuv
1 parent 6f11cff commit a62b814

File tree

2 files changed

+124
-0
lines changed

2 files changed

+124
-0
lines changed

configs/libs/yuv.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#! /usr/bin/env bash
2+
#
3+
# Copyright (C) 2021 Matt Reach<[email protected]>
4+
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
#
18+
#
19+
20+
export LIB_NAME='yuv'
21+
export LIPO_LIBS="libyuv"
22+
export LIB_DEPENDS_BIN="cmake"
23+
export GIT_LOCAL_REPO=extra/yuv
24+
export GIT_COMMIT=eb6e7bb
25+
export REPO_DIR=yuv
26+
export GIT_REPO_VERSION=stable
27+
export PRE_COMPILE_TAG=yuv-stable-241227150449
28+
29+
# you can export GIT_YUV_UPSTREAM=git@xx:yy/yuv.git use your mirror
30+
if [[ "$GIT_YUV_UPSTREAM" != "" ]] ;then
31+
export GIT_UPSTREAM="$GIT_YUV_UPSTREAM"
32+
else
33+
export GIT_UPSTREAM=https://github.com/debugly/libyuv.git
34+
fi

do-compile/yuv.sh

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#! /usr/bin/env bash
2+
#
3+
# Copyright (C) 2021 Matt Reach<[email protected]>
4+
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# https://stackoverflow.com/questions/6003374/what-is-cmake-equivalent-of-configure-prefix-dir-make-all-install
18+
# https://cmake.org/cmake/help/v3.28/variable/CMAKE_OSX_SYSROOT.html
19+
# https://cmake.org/cmake/help/v3.14/manual/cmake-toolchains.7.html#switching-between-device-and-simulator
20+
# https://stackoverflow.com/questions/27660048/cmake-check-if-mac-os-x-use-apple-or-apple
21+
22+
set -e
23+
24+
THIS_DIR=$(DIRNAME=$(dirname "$0"); cd "$DIRNAME"; pwd)
25+
cd "$THIS_DIR"
26+
source ../tools/env_assert.sh
27+
28+
echo "=== [$0] check env begin==="
29+
env_assert "XC_ARCH"
30+
env_assert "_XC_ARCH"
31+
env_assert "XC_BUILD_NAME"
32+
env_assert "XCRUN_CC"
33+
env_assert "XC_DEPLOYMENT_TARGET"
34+
env_assert "XC_BUILD_SOURCE"
35+
env_assert "XC_BUILD_PREFIX"
36+
env_assert "XCRUN_SDK_PATH"
37+
env_assert "XC_THREAD"
38+
env_assert "XC_PLAT"
39+
echo "XC_DEBUG:$XC_DEBUG"
40+
echo "===check env end==="
41+
42+
43+
toolchain=$PWD/../tools/ios.toolchain.cmake
44+
45+
echo "----------------------"
46+
echo "[*] configurate $LIB_NAME"
47+
echo "[*] cmake config $cfg"
48+
echo "[*] cmake toolchain $toolchain"
49+
echo "----------------------"
50+
51+
build="${XC_BUILD_SOURCE}/_tmp"
52+
53+
rm -rf "$build"
54+
mkdir -p "$build"
55+
56+
cd "$build"
57+
58+
pf=
59+
if [[ "$XC_PLAT" == 'ios' ]];then
60+
if [[ $_XC_ARCH == 'arm64_simulator' ]];then
61+
pf='SIMULATORARM64'
62+
elif [[ $_XC_ARCH == 'x86_64_simulator' ]];then
63+
pf='SIMULATOR64'
64+
else
65+
pf='OS64'
66+
fi
67+
elif [[ "$XC_PLAT" == 'tvos' ]];then
68+
if [[ $_XC_ARCH == 'arm64_simulator' ]];then
69+
pf='SIMULATORARM64_TVOS'
70+
elif [[ $_XC_ARCH == 'x86_64_simulator' ]];then
71+
pf='SIMULATOR_TVOS'
72+
else
73+
pf='TVOS'
74+
fi
75+
elif [[ "$XC_PLAT" == 'macos' ]];then
76+
if [[ $_XC_ARCH == 'arm64' ]];then
77+
pf='MAC_ARM64'
78+
elif [[ $_XC_ARCH == 'x86_64' ]];then
79+
pf='MAC'
80+
fi
81+
fi
82+
83+
cmake -S ${XC_BUILD_SOURCE} -DCMAKE_INSTALL_PREFIX=${XC_BUILD_PREFIX} -GXcode -DBUILD_SHARED_LIBS=0 -DCMAKE_TOOLCHAIN_FILE=$toolchain -DCOMPILE_10BIT=1 -DPLATFORM=$pf
84+
85+
echo "----------------------"
86+
echo "[*] compile $LIB_NAME"
87+
echo "----------------------"
88+
89+
cmake --build . --config Release -- CODE_SIGNING_ALLOWED=NO
90+
cmake --install .

0 commit comments

Comments
 (0)