[vlc-devel] [PATCH 2/2] package/win32: build.sh: add options to do build for Winstore
Steve Lhomme
robux4 at ycbcr.xyz
Thu Apr 9 13:59:53 CEST 2020
This is mostly a port of this build script to our build script:
https://code.videolan.org/videolan/vlc-winrt/-/blob/master/libvlc/compile.sh
The Winstore build tweaks are only enabled with the Universal Runtime flag.
There are less disabled modules.
---
extras/package/win32/build.sh | 31 ++++++++++++++++++++++++++++---
extras/package/win32/configure.sh | 4 ----
2 files changed, 28 insertions(+), 7 deletions(-)
diff --git a/extras/package/win32/build.sh b/extras/package/win32/build.sh
index f192cbb341c..3aac437eafb 100755
--- a/extras/package/win32/build.sh
+++ b/extras/package/win32/build.sh
@@ -30,11 +30,12 @@ OPTIONS:
-d Create PDB files during the build
-x Add extra checks when compiling
-u Use the Universal C Runtime
+ -w Restrict to Windows Store APIs
EOF
}
ARCH="x86_64"
-while getopts "hra:pcli:sb:dxu" OPTION
+while getopts "hra:pcli:sb:dxuw" OPTION
do
case $OPTION in
h)
@@ -75,6 +76,10 @@ do
u)
BUILD_UCRT="yes"
;;
+ w)
+ WINSTORE="-lwinstorecompat"
+ TRIPLET_SUFFIX=uwp
+ ;;
esac
done
shift $(($OPTIND - 1))
@@ -107,7 +112,8 @@ esac
SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )"
: ${JOBS:=$(getconf _NPROCESSORS_ONLN 2>&1)}
-TRIPLET=$ARCH-w64-mingw32
+BASE_TRIPLET=$ARCH-w64-mingw32
+TRIPLET=$BASE_TRIPLET$TRIPLET_SUFFIX
# Check if compiling with clang
CC=${CC:-$TRIPLET-gcc}
@@ -163,8 +169,13 @@ fi
if [ ! -z "$BUILD_UCRT" ]; then
SHORTARCH="$SHORTARCH-ucrt"
CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00 -D_UNICODE -DUNICODE"
+ if [ ! -z "$WINSTORE" ]; then
+ SHORTARCH="$SHORTARCH-uwp"
+ CPPFLAGS="$CPPFLAGS -DWINSTORECOMPAT -DWINAPI_FAMILY=WINAPI_FAMILY_APP"
+ LDFLAGS="$LDFLAGS $WINSTORE"
+ fi
if [ ! "$COMPILING_WITH_CLANG" -gt 0 ]; then
- ${CC} -dumpspecs | sed -e "s/-lmingwex/-lmingwex -lruntimeobject -lsynchronization/" -e "s/-lmsvcrt/-lucrt/" -e "s/-lkernel32/-lwindowsapp/" > ../newspecfile
+ ${CC} -dumpspecs | sed -e "s/-lmingwex/$WINSTORE -lmingwex $WINSTORE -lruntimeobject -lsynchronization/" -e "s/-lmsvcrt/-lucrt/" -e "s/-lkernel32/-lwindowsapp/" > ../newspecfile
NEWSPECFILE="$PWD/../newspecfile"
CC="${CC} -specs=$NEWSPECFILE"
CXX="${CXX} -specs=$NEWSPECFILE"
@@ -190,6 +201,15 @@ if [ "$RELEASE" != "yes" ]; then
CONTRIBFLAGS="$CONTRIBFLAGS --disable-optim"
fi
if [ ! -z "$BUILD_UCRT" ]; then
+ if [ ! -z "$WINSTORE" ]; then
+ CONTRIBFLAGS="$CONTRIBFLAGS --disable-qt --disable-qtsvg --disable-qtdeclarative --disable-qtgraphicaleffects --disable-qtquickcontrols2"
+ CONTRIBFLAGS="$CONTRIBFLAGS --disable-disc --disable-srt --disable-sdl --disable-SDL_image --disable-caca"
+ # modplug uses GlobalAlloc/Free (now allowed) and lstrcpyA/wsprintfA/lstrcpynA
+ CONTRIBFLAGS="$CONTRIBFLAGS --disable-modplug"
+ # x265 uses too many forbidden APIs
+ CONTRIBFLAGS="$CONTRIBFLAGS --disable-x265"
+ fi
+else
CONTRIB_PREFIX="$CONTRIB_PREFIX$BUILD_UCRT"
fi
@@ -266,6 +286,11 @@ if [ ! -z "$WITH_PDB" ]; then
CONFIGFLAGS="$CONFIGFLAGS --enable-pdb"
fi
if [ ! -z "$BUILD_UCRT" ]; then
+ if [ ! -z "$WINSTORE" ]; then
+ CONFIGFLAGS="$CONFIGFLAGS --enable-winstore-app --disable-vlc --disable-qt --disable-skins2"
+ else
+ CONFIGFLAGS="$CONFIGFLAGS --enable-dvdread --enable-caca"
+ fi
CFLAGS="$CFLAGS $CPPFLAGS"
CXXFLAGS="$CXXFLAGS $CPPFLAGS"
fi
diff --git a/extras/package/win32/configure.sh b/extras/package/win32/configure.sh
index ddf441a90ec..52b6d000bf9 100755
--- a/extras/package/win32/configure.sh
+++ b/extras/package/win32/configure.sh
@@ -11,12 +11,8 @@ OPTIONS="
--enable-libass
--enable-schroedinger
--enable-live555
- --enable-dvdread
--enable-shout
--enable-goom
- --enable-caca
- --enable-qt
- --enable-skins2
--enable-sse --enable-mmx
--enable-libcddb
--enable-zvbi --disable-telx
--
2.17.1
More information about the vlc-devel
mailing list