[vlc-commits] [Git][videolan/vlc][master] 4 commits: package/win32: build.sh: add an option to set the Windows SDK version

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Thu Oct 7 13:39:20 UTC 2021



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
62cdc93a by Steve Lhomme at 2021-10-07T11:03:47+00:00
package/win32: build.sh: add an option to set the Windows SDK version

The NTDDI version contains the windows version and the subversion like the
Windows 10 flavor or Service Pack. This is supported by mingw64 and MSDK.

https://docs.microsoft.com/en-us/windows/win32/winprog/using-the-windows-headers

- - - - -
ed386c86 by Steve Lhomme at 2021-10-07T11:03:47+00:00
CI: add win64 targets built with ucrt

These are Win10 builds with a maximum API support of Windows 1809 = Redstone 5.

We use the LLVM "UWP" image as it's the one with UCRT runtime by default. It's
not tied to UWP API's only.

Only the C runtime is different compared to the win64 LLVM builds we already have.

- - - - -
6df85ff6 by Steve Lhomme at 2021-10-07T11:03:47+00:00
mft: don't force an older WINVER value

We already build for a version equal or higher than 0x0601 (Win7)

- - - - -
b460a447 by Steve Lhomme at 2021-10-07T11:03:47+00:00
skins2: remove outdated WINVER value

We don't need to force it to Win2K.

- - - - -


4 changed files:

- extras/ci/gitlab-ci.yml
- extras/package/win32/build.sh
- modules/codec/mft.c
- modules/gui/skins2/win32/win32_graphics.cpp


Changes:

=====================================
extras/ci/gitlab-ci.yml
=====================================
@@ -166,6 +166,16 @@ win64-llvm:
         <<: *variables-win64
         WINE_SDK_PATH: /usr/include/wine/wine/windows/
 
+win64-ucrt-llvm:
+    extends: .win-common
+    image:
+        name: $VLC_UWP_LLVM_IMAGE
+    variables:
+        <<: *variables-win64
+        WINE_SDK_PATH: /usr/include/wine/wine/windows/
+        TRIPLET: $HOST_ARCH-ucrt-w64-mingw32
+        UWP_EXTRA_BUILD_FLAGS: -u -x -S 0x0A000006
+
 uwp64-libvlc-llvm:
     extends: .win-common
     image:
@@ -218,6 +228,16 @@ nightly-win64-llvm:
         <<: *variables-win64
         WINE_SDK_PATH: /usr/include/wine/wine/windows/
 
+nightly-win64-ucrt-llvm:
+    extends: .nightly-win-common
+    image:
+        name: $VLC_UWP_LLVM_IMAGE
+    variables:
+        <<: *variables-win64
+        WINE_SDK_PATH: /usr/include/wine/wine/windows/
+        TRIPLET: $HOST_ARCH-ucrt-w64-mingw32
+        UWP_EXTRA_BUILD_FLAGS: -u -x -S 0x0A000006
+
 #
 # Debian
 #


=====================================
extras/package/win32/build.sh
=====================================
@@ -31,6 +31,7 @@ OPTIONS:
    -D <win_path> Create PDB files during the build, map the VLC sources to <win_path>
                  e.g.: -D c:/sources/vlc
    -x            Add extra checks when compiling
+   -S <sdkver>   Use maximum Windows API version (0x0601000 by default)
    -u            Use the Universal C Runtime (instead of msvcrt)
    -w            Restrict to Windows Store APIs
    -z            Build without GUI (libvlc only)
@@ -39,7 +40,7 @@ EOF
 }
 
 ARCH="x86_64"
-while getopts "hra:pcli:sb:dD:xuwzo:" OPTION
+while getopts "hra:pcli:sb:dD:xS:uwzo:" OPTION
 do
      case $OPTION in
          h)
@@ -81,6 +82,9 @@ do
          x)
              EXTRA_CHECKS="yes"
          ;;
+         S)
+             NTDDI=$OPTARG
+         ;;
          u)
              BUILD_UCRT="yes"
          ;;
@@ -218,7 +222,16 @@ if [ ! -z "$BUILD_UCRT" ]; then
 
     if [ ! -z "$WINSTORE" ]; then
         SHORTARCH="$SHORTARCH-uwp"
-        CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00 -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_UNICODE -DUNICODE"
+        CPPFLAGS="$CPPFLAGS -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_UNICODE -DUNICODE"
+
+        if [ -z "$NTDDI" ]; then
+            WINVER=0x0A00
+        else
+            WINVER=`echo ${NTDDI} |cut -c 1-6`
+            if [ "$WINVER" != "0x0A00" ]; then
+                echo "Unsupported SDK/NTDDI version ${NTDDI} for Winstore"
+            fi
+        fi
 
         # WinstoreCompat: hopefully can go away someday
         LDFLAGS="$LDFLAGS -lwindowsapp -lwindowsappcompat"
@@ -228,8 +241,6 @@ if [ ! -z "$BUILD_UCRT" ]; then
         EXTRA_CRUNTIME="vcruntime140_app"
     else
         SHORTARCH="$SHORTARCH-ucrt"
-        # The current minimum for VLC is Windows 7
-        CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x0601 -DWINVER=0x0601"
         # this library doesn't exist yet, so use ucrt twice as a placeholder
         # EXTRA_CRUNTIME="vcruntime140"
         EXTRA_CRUNTIME="ucrt"
@@ -258,11 +269,24 @@ if [ ! -z "$BUILD_UCRT" ]; then
 
     # the values are not passed to the makefiles/configures
     export LDFLAGS
-    export CPPFLAGS
 else
-    # The current minimum for VLC is Windows 7 and to use the regular msvcrt
-    CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x0601 -DWINVER=0x0601 -D__MSVCRT_VERSION__=0x700"
+    # use the regular msvcrt
+    CPPFLAGS="$CPPFLAGS -D__MSVCRT_VERSION__=0x700"
 fi
+
+if [ -n "$NTDDI" ]; then
+    WINVER=`echo ${NTDDI} |cut -c 1-6`
+    CPPFLAGS="$CPPFLAGS -DNTDDI_VERSION=$NTDDI"
+fi
+if [ -z "$WINVER" ]; then
+    # The current minimum for VLC is Windows 7
+    WINVER=0x0601
+fi
+CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=${WINVER} -DWINVER=${WINVER}"
+
+# the values are not passed to the makefiles/configures
+export CPPFLAGS
+
 CFLAGS="$CPPFLAGS $CFLAGS"
 CXXFLAGS="$CPPFLAGS $CXXFLAGS"
 


=====================================
modules/codec/mft.c
=====================================
@@ -24,9 +24,6 @@
 # include "config.h"
 #endif
 
-#undef WINVER
-#define WINVER 0x0601
-
 /* Needed for many mingw macros. */
 #define COBJMACROS
 


=====================================
modules/gui/skins2/win32/win32_graphics.cpp
=====================================
@@ -23,8 +23,6 @@
 
 #ifdef WIN32_SKINS
 
-#define WINVER 0x500
-
 #include "win32_factory.hpp"
 #include "win32_graphics.hpp"
 #include "win32_window.hpp"



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a88b1f3333bc201f6704798f4728f7587a16231a...b460a4474fa8a8ce1fc14372c4b76d5d25251edd

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a88b1f3333bc201f6704798f4728f7587a16231a...b460a4474fa8a8ce1fc14372c4b76d5d25251edd
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list