Skip to content

Commit 3fc89a8

Browse files
committed
test
1 parent 226ee63 commit 3fc89a8

File tree

2 files changed

+171
-48
lines changed

2 files changed

+171
-48
lines changed

build.sh

Lines changed: 63 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fi
1616
shift 3 || true
1717
FF_ARGS=$@
1818

19-
for dep in libharfbuzz libfreetype sdl libjxl; do
19+
for dep in libharfbuzz libfreetype sdl libjxl libvpx; do
2020
if grep -q "enable-${dep}" FFmpeg/configure; then
2121
export ENABLE_${dep^^}=1
2222
FF_ARGS="$FF_ARGS --enable-$dep"
@@ -45,67 +45,83 @@ apply-patch harfbuzz harfbuzz.patch
4545
# ./build-meson-dep.sh fribidi -Ddocs=false
4646
# ./build-meson-dep.sh libass
4747

48-
if [ "$BUILD_LICENSE" == "gpl" ]; then
48+
# if [ "$BUILD_LICENSE" == "gpl" ]; then
4949

50-
apply-patch x265_git x265_git-${BUILD_TYPE}.patch
50+
# apply-patch x265_git x265_git-${BUILD_TYPE}.patch
5151

52-
if [ "$BUILD_TYPE" == "static" ]; then
53-
X265_ARGS="-DSTATIC_LINK_CRT=ON"
54-
ENABLE_SHARED=OFF
55-
else
56-
X265_ARGS="-DSTATIC_LINK_CRT=OFF"
57-
ENABLE_SHARED=ON
58-
fi
52+
# if [ "$BUILD_TYPE" == "static" ]; then
53+
# X265_ARGS="-DSTATIC_LINK_CRT=ON"
54+
# ENABLE_SHARED=OFF
55+
# else
56+
# X265_ARGS="-DSTATIC_LINK_CRT=OFF"
57+
# ENABLE_SHARED=ON
58+
# fi
5959

60-
if [ "$BUILD_ARCH" == arm ]; then
61-
apply-patch x265_git x265_git-arm.patch
62-
fi
60+
# if [ "$BUILD_ARCH" == arm ]; then
61+
# apply-patch x265_git x265_git-arm.patch
62+
# fi
6363

64-
git -C x265_git fetch --tags
65-
./build-cmake-dep.sh x265_git/source -DCMAKE_SYSTEM_NAME=Windows -DENABLE_SHARED=$ENABLE_SHARED -DENABLE_CLI=OFF $X265_ARGS
66-
FF_ARGS="$FF_ARGS --enable-libx265"
64+
# git -C x265_git fetch --tags
65+
# ./build-cmake-dep.sh x265_git/source -DCMAKE_SYSTEM_NAME=Windows -DENABLE_SHARED=$ENABLE_SHARED -DENABLE_CLI=OFF $X265_ARGS
66+
# FF_ARGS="$FF_ARGS --enable-libx265"
6767

68-
if [ "$BUILD_TYPE" == "shared" ]; then
69-
apply-patch x264 x264-${BUILD_TYPE}.patch
70-
fi
71-
if [[ "$BUILD_ARCH" =~ arm ]]; then
72-
X264_ARGS="--disable-asm"
73-
fi
68+
# if [ "$BUILD_TYPE" == "shared" ]; then
69+
# apply-patch x264 x264-${BUILD_TYPE}.patch
70+
# fi
71+
# if [[ "$BUILD_ARCH" =~ arm ]]; then
72+
# X264_ARGS="--disable-asm"
73+
# fi
7474

75-
INSTALL_TARGET=install-lib-${BUILD_TYPE} ./build-make-dep.sh x264 --enable-${BUILD_TYPE} $X264_ARGS
76-
FF_ARGS="$FF_ARGS --enable-libx264"
75+
# INSTALL_TARGET=install-lib-${BUILD_TYPE} ./build-make-dep.sh x264 --enable-${BUILD_TYPE} $X264_ARGS
76+
# FF_ARGS="$FF_ARGS --enable-libx264"
7777

78-
fi
78+
# fi
7979

80-
./build-make-dep.sh nv-codec-headers
80+
# ./build-make-dep.sh nv-codec-headers
8181

82-
CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded ./build-cmake-dep.sh zlib
82+
# CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded ./build-cmake-dep.sh zlib
8383

84-
if [ -n "$ENABLE_LIBFREETYPE" ]; then
85-
./build-cmake-dep.sh freetype
86-
fi
84+
# if [ -n "$ENABLE_LIBFREETYPE" ]; then
85+
# ./build-cmake-dep.sh freetype
86+
# fi
8787

88-
if [ -n "$ENABLE_LIBHARFBUZZ" ]; then
89-
./build-cmake-dep.sh harfbuzz -DHB_HAVE_FREETYPE=ON
90-
fi
88+
# if [ -n "$ENABLE_LIBHARFBUZZ" ]; then
89+
# ./build-cmake-dep.sh harfbuzz -DHB_HAVE_FREETYPE=ON
90+
# fi
9191

92-
if [ -n "$ENABLE_SDL" ]; then
93-
./build-cmake-dep.sh SDL
94-
fi
92+
# if [ -n "$ENABLE_SDL" ]; then
93+
# ./build-cmake-dep.sh SDL
94+
# fi
9595

96-
if [ -n "$ENABLE_LIBJXL" ]; then
96+
# if [ -n "$ENABLE_LIBJXL" ]; then
9797

98-
if [ "$BUILD_TYPE" == "shared" ]; then
99-
JPEGXL_STATIC=OFF
100-
else
101-
JPEGXL_STATIC=ON
102-
fi
98+
# if [ "$BUILD_TYPE" == "shared" ]; then
99+
# JPEGXL_STATIC=OFF
100+
# else
101+
# JPEGXL_STATIC=ON
102+
# fi
103103

104-
apply-patch libjxl libjxl.patch
105-
./build-cmake-dep.sh openexr -DOPENEXR_INSTALL_TOOLS=OFF -DOPENEXR_BUILD_TOOLS=OFF -DBUILD_TESTING=OFF -DOPENEXR_IS_SUBPROJECT=ON
106-
./build-cmake-dep.sh libjxl -DBUILD_TESTING=OFF -DJPEGXL_ENABLE_BENCHMARK=OFF -DJPEGXL_ENABLE_JNI=OFF -DJPEGXL_BUNDLE_LIBPNG=OFF -DJPEGXL_ENABLE_TOOLS=OFF -DJPEGXL_ENABLE_EXAMPLES=OFF -DJPEGXL_STATIC=$JPEGXL_STATIC
107-
fi
104+
# apply-patch libjxl libjxl.patch
105+
# ./build-cmake-dep.sh openexr -DOPENEXR_INSTALL_TOOLS=OFF -DOPENEXR_BUILD_TOOLS=OFF -DBUILD_TESTING=OFF -DOPENEXR_IS_SUBPROJECT=ON
106+
# ./build-cmake-dep.sh libjxl -DBUILD_TESTING=OFF -DJPEGXL_ENABLE_BENCHMARK=OFF -DJPEGXL_ENABLE_JNI=OFF -DJPEGXL_BUNDLE_LIBPNG=OFF -DJPEGXL_ENABLE_TOOLS=OFF -DJPEGXL_ENABLE_EXAMPLES=OFF -DJPEGXL_STATIC=$JPEGXL_STATIC
107+
# fi
108108

109109
# libvpx AR=lib ARFLAGS= CC=cl CXX=cl LD=link STRIP=false ./configure --as=yasm --disable-optimizations --disable-dependency-tracking --disable-runtime-cpu-detect --disable-thumb --disable-neon
110-
110+
# AR=lib ARFLAGS= CC=cl CXX=cl LD=link STRIP=false ./configure --target=armv7-win32-vs17 --as=yasm --disable-optimizations --disable-dependency-tracking --disable-runtime-cpu-detect --disable-thumb --disable-neon --enable-external-build --enable-static-msvcrt
111+
112+
if [ -n "$ENABLE_LIBVPX" ]; then
113+
case $BUILD_ARCH in
114+
amd64)) toolchain=x86_64-win64-vs17;;
115+
x86)) toolchain=x86-win32-vs17;;
116+
arm)) toolchain=armv7-win32-vs17;;
117+
arm64)) toolchain=arm64-win64-vs17;;
118+
esac
119+
120+
if [ "$BUILD_TYPE" == "static" ]; then
121+
LIBVPX_ARGS="--enable-static-msvcrt"
122+
fi
123+
apply-patch libvpx libvpx.patch
124+
AR=lib ARFLAGS= CC=cl CXX=cl LD=link STRIP=false ./build-make-dep.sh libvpx --target=$toolchain --as=yasm --disable-optimizations --disable-dependency-tracking --disable-runtime-cpu-detect --disable-thumb --disable-neon --enable-external-build $LIBVPX_ARGS
125+
FF_ARGS=--enable-libvpx
126+
fi
111127
./build-ffmpeg.sh FFmpeg $FF_ARGS

patches/libvpx.patch

Lines changed: 108 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,32 @@ index d1d89aa69..155c43c54 100644
184184
LDFLAGS = ${LDFLAGS}
185185
ASFLAGS = ${ASFLAGS}
186186
extralibs = ${extralibs}
187+
diff --git a/build/make/gen_msvs_sln.sh b/build/make/gen_msvs_sln.sh
188+
index 0b312850f..2328bd57e 100755
189+
--- a/build/make/gen_msvs_sln.sh
190+
+++ b/build/make/gen_msvs_sln.sh
191+
@@ -70,7 +70,9 @@ parse_project() {
192+
cur_config_list=`grep -B1 'Label="Configuration"' $file |
193+
grep Condition | cut -d\' -f4`
194+
new_config_list=$(for i in $config_list $cur_config_list; do
195+
- echo $i
196+
+ if [[ $i =~ ^$target_config ]];then
197+
+ echo $i
198+
+ fi
199+
done | sort | uniq)
200+
if [ "$config_list" != "" ] && [ "$config_list" != "$new_config_list" ]; then
201+
mixed_platforms=1
202+
@@ -225,6 +227,8 @@ for opt in "$@"; do
203+
;;
204+
--target=*) target="${optval}"
205+
;;
206+
+ --config=*) target_config="${optval}"
207+
+ ;;
208+
-*) die_unknown $opt
209+
;;
210+
*) file_list[${#file_list[@]}]="$opt"
187211
diff --git a/build/make/gen_msvs_vcxproj.sh b/build/make/gen_msvs_vcxproj.sh
188-
index 1e1db05bb..0ba1d590d 100755
212+
index 1e1db05bb..5b7e090ed 100755
189213
--- a/build/make/gen_msvs_vcxproj.sh
190214
+++ b/build/make/gen_msvs_vcxproj.sh
191215
@@ -311,7 +311,8 @@ generate_vcxproj() {
@@ -209,3 +233,86 @@ index 1e1db05bb..0ba1d590d 100755
209233
fi
210234
if [ "${platforms[0]}" = "ARM64" ]; then
211235
# Require the first Visual Studio version to have ARM64 support.
236+
@@ -402,6 +403,7 @@ generate_vcxproj() {
237+
fi
238+
tag_content TargetName "${name}${lib_sfx}${config_suffix}"
239+
fi
240+
+ tag_content ExecutablePath "\$(VC_ExecutablePath_x64_ARM);\$(CommonExecutablePath)"
241+
close_tag PropertyGroup
242+
done
243+
done
244+
diff --git a/libs.mk b/libs.mk
245+
index d5076b7e8..f7f615bfd 100644
246+
--- a/libs.mk
247+
+++ b/libs.mk
248+
@@ -152,8 +152,8 @@ INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/vpx_ports/%
249+
INSTALL_MAPS += $(LIBSUBDIR)/% %
250+
INSTALL_MAPS += src/% $(SRC_PATH_BARE)/%
251+
ifeq ($(CONFIG_MSVS),yes)
252+
-INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/% $(p)/Release/%)
253+
-INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/% $(p)/Debug/%)
254+
+INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/% $(p)/Release/%)
255+
+#INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/% $(p)/Debug/%)
256+
endif
257+
258+
CODEC_SRCS-yes += build/make/version.sh
259+
@@ -181,10 +181,10 @@ INSTALL-LIBS-$(CONFIG_ENCODERS) += include/vpx/vpx_encoder.h
260+
INSTALL-LIBS-$(CONFIG_ENCODERS) += include/vpx/vpx_tpl.h
261+
ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
262+
ifeq ($(CONFIG_MSVS),yes)
263+
-INSTALL-LIBS-yes += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/$(CODEC_LIB).lib)
264+
-INSTALL-LIBS-$(CONFIG_DEBUG_LIBS) += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/$(CODEC_LIB)d.lib)
265+
-INSTALL-LIBS-$(CONFIG_SHARED) += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/vpx.dll)
266+
-INSTALL-LIBS-$(CONFIG_SHARED) += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/vpx.exp)
267+
+INSTALL-LIBS-yes += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(CODEC_LIB).lib)
268+
+INSTALL-LIBS-$(CONFIG_DEBUG_LIBS) += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(CODEC_LIB)d.lib)
269+
+INSTALL-LIBS-$(CONFIG_SHARED) += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/vpx.dll)
270+
+INSTALL-LIBS-$(CONFIG_SHARED) += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/vpx.exp)
271+
endif
272+
else
273+
INSTALL-LIBS-$(CONFIG_STATIC) += $(LIBSUBDIR)/libvpx.a
274+
@@ -299,6 +299,32 @@ PROJECTS-yes += vpxrc.$(VCPROJ_SFX)
275+
vpxrc.$(VCPROJ_SFX): vpx_config.asm
276+
vpxrc.$(VCPROJ_SFX): $(RTCD)
277+
278+
+
279+
+LIBS-yes += vpx.pc
280+
+vpx.pc: config.mk libs.mk
281+
+ @echo " [CREATE] $@"
282+
+ $(qexec)echo '# pkg-config file from libvpx $(VERSION_STRING)' > $@
283+
+ $(qexec)echo 'prefix=$(PREFIX)' >> $@
284+
+ $(qexec)echo 'exec_prefix=$${prefix}' >> $@
285+
+ $(qexec)echo 'libdir=$${prefix}/$(LIBSUBDIR)' >> $@
286+
+ $(qexec)echo 'includedir=$${prefix}/include' >> $@
287+
+ $(qexec)echo '' >> $@
288+
+ $(qexec)echo 'Name: vpx' >> $@
289+
+ $(qexec)echo 'Description: WebM Project VPx codec implementation' >> $@
290+
+ $(qexec)echo 'Version: $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)' >> $@
291+
+ $(qexec)echo 'Requires:' >> $@
292+
+ $(qexec)echo 'Conflicts:' >> $@
293+
+ $(qexec)echo 'Libs: -L$${libdir} -lvpx$(if $(CONFIG_STATIC_MSVCRT),mt,md)' >> $@
294+
+ifeq ($(HAVE_PTHREAD_H),yes)
295+
+ $(qexec)echo 'Libs.private: -lpthread' >> $@
296+
+else
297+
+ $(qexec)echo 'Libs.private: ' >> $@
298+
+endif
299+
+ $(qexec)echo 'Cflags: -I$${includedir}' >> $@
300+
+INSTALL-LIBS-yes += $(LIBSUBDIR)/pkgconfig/vpx.pc
301+
+INSTALL_MAPS += $(LIBSUBDIR)/pkgconfig/%.pc %.pc
302+
+CLEAN-OBJS += vpx.pc
303+
+
304+
endif # ifeq ($(CONFIG_MSVS),yes)
305+
else # ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
306+
LIBVPX_OBJS=$(call objs, $(filter-out $(ASM_INCLUDES), $(CODEC_SRCS)))
307+
diff --git a/solution.mk b/solution.mk
308+
index 145adc0dd..5c1b3ff19 100644
309+
--- a/solution.mk
310+
+++ b/solution.mk
311+
@@ -16,6 +16,7 @@ VPX_RDEPS=$(foreach vcp,\
312+
vpx.sln: $(wildcard *.$(VCPROJ_SFX))
313+
@echo " [CREATE] $@"
314+
$(SRC_PATH_BARE)/build/make/gen_msvs_sln.sh \
315+
+ "--config=Release" \
316+
$(if $(filter vpx.$(VCPROJ_SFX),$^),$(VPX_RDEPS)) \
317+
--dep=test_libvpx:gtest \
318+
--ver=$(CONFIG_VS_VERSION)\

0 commit comments

Comments
 (0)