Browse Source

meson: add initial winstore support

This patch tries to replicate configure.ac (at the time of writing)
from line 407 - 438, except the strict aliasing check. Libraries such as
ole32 are linked by default by meson, so those have been omitted.
Another difference: the check has been moved out of the mingw check.

This is not meant to be functional just yet, but having the winstore
option gives a starting point for further support.
pull/141/head
Johannes Kauffmann 4 years ago
committed by Steve Lhomme
parent
commit
a01c567bff
  1. 4
      config.h.meson
  2. 21
      meson.build
  3. 3
      src/meson.build

4
config.h.meson

@ -604,8 +604,8 @@
/* host which ran configure */
#mesondefine VLC_COMPILE_HOST
/* TODO: Define to 1 if you want to build for Windows Store apps */
#undef VLC_WINSTORE_APP
/* Define to 1 if building for Windows Store. */
#mesondefine VLC_WINSTORE_APP
/* Define to 1 if build machine is big endian */
#mesondefine WORDS_BIGENDIAN

21
meson.build

@ -277,6 +277,8 @@ endif
#
have_mingw = false
have_win_desktop = false
have_win_store = false
mingw_libs = []
if host_system == 'windows'
@ -363,6 +365,9 @@ windows_version_test = '''
mingw_libs += mingwex_lib
endif
# TODO: enable when meson 0.63 is required
# add_project_dependencies(mingw_libs, language: ['c', 'cpp'])
# Check for fnative-struct or mms-bitfields support for MinGW
if cc.has_argument('-mms-bitfields')
add_project_arguments('-mms-bitfields',
@ -384,6 +389,18 @@ windows_version_test = '''
language: ['c', 'cpp'])
endif
# Check if we are building for Windows Store
if get_option('winstore_app')
have_win_store = true
cdata.set('VLC_WINSTORE_APP', 1)
add_project_arguments('-DWINSTORECOMPAT', language: ['c', 'cpp'])
windowsappcompat_lib = cc.find_library('windowsappcompat')
# TODO: enable when meson 0.63 is required
# add_project_dependencies(windowsappcompat_lib, language: ['c', 'cpp'])
else
have_win_desktop = true
endif
endif
if cc.has_argument('-Werror-implicit-function-declaration')
@ -573,6 +590,10 @@ endif
libcompat_sources = []
if have_win_store
libcompat_sources += 'gai_strerror.c'
endif
# Check all functions in libcompat_functions array
foreach f : libcompat_functions
if cc.has_function(f[0], prefix : vlc_conf_prefix + f[1], dependencies: [rt_lib, socket_libs])

3
src/meson.build

@ -54,6 +54,9 @@ min_windows_version_test = '''
libvlccore_deps += cc.find_library('bcrypt')
libvlccore_deps += cc.find_library('winmm')
libvlccore_deps += cc.find_library('normaliz')
if have_win_store
libvlccore_deps += cc.find_library('runtimeobject')
endif
if cc.compiles(min_windows_version_test.format('_WIN32_WINNT_WIN8'), name: 'Compiling for Win8+')
libvlccore_deps += cc.find_library('synchronization')
endif

Loading…
Cancel
Save