win32: Fix meson build system for Windows.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/360>
This commit is contained in:
Edward Lee 2020-10-01 10:24:40 -04:00 committed by Arun Raghavan
parent 7bc559fe26
commit b892e327a9
7 changed files with 127 additions and 55 deletions

View file

@ -31,7 +31,7 @@ executable('pulseaudio',
include_directories : [configinc, topinc],
link_args : ['-ffast-math'],
link_with : [libpulsecore, libpulsecommon, libpulse],
dependencies : [ltdl_dep, cap_dep, dbus_dep, libsystemd_dep, dl_dep, libintl_dep],
dependencies : [ltdl_dep, cap_dep, dbus_dep, libsystemd_dep, dl_dep, libintl_dep, platform_dep, platform_socket_dep],
c_args : pa_c_args,
)

View file

@ -39,7 +39,6 @@ libpulsecommon_sources = [
'pulsecore/memblock.c',
'pulsecore/memblockq.c',
'pulsecore/memchunk.c',
'pulsecore/mutex-posix.c',
'pulsecore/native-common.c',
'pulsecore/once.c',
'pulsecore/packet.c',
@ -56,7 +55,6 @@ libpulsecommon_sources = [
'pulsecore/random.c',
'pulsecore/srbchannel.c',
'pulsecore/sample-util.c',
'pulsecore/semaphore-posix.c',
'pulsecore/shm.c',
'pulsecore/bitset.c',
'pulsecore/socket-client.c',
@ -65,7 +63,6 @@ libpulsecommon_sources = [
'pulsecore/strbuf.c',
'pulsecore/strlist.c',
'pulsecore/tagstruct.c',
'pulsecore/thread-posix.c',
'pulsecore/time-smoother.c',
'pulsecore/tokenizer.c',
'pulsecore/usergroup.c',
@ -177,6 +174,20 @@ if x11_dep.found()
endif
# FIXME: Do non-POSIX thread things
if host_machine.system() == 'windows'
libpulsecommon_sources += [
'pulsecore/mutex-win32.c',
'pulsecore/poll-win32.c',
'pulsecore/semaphore-win32.c',
'pulsecore/thread-win32.c',
]
else
libpulsecommon_sources += [
'pulsecore/mutex-posix.c',
'pulsecore/semaphore-posix.c',
'pulsecore/thread-posix.c'
]
endif
# FIXME: Do SIMD things
libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor,
@ -190,6 +201,7 @@ libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor,
dependencies : [
libm_dep, thread_dep, dl_dep, shm_dep, iconv_dep, sndfile_dep, dbus_dep,
x11_dep, libsystemd_dep, glib_dep, gtk_dep, asyncns_dep, libintl_dep,
platform_dep, platform_socket_dep,
],
implicit_include_directories : false)

View file

@ -1,4 +1,6 @@
subdir('rtp')
if host_machine.system() != 'windows'
subdir('rtp')
endif
# module name, sources, [headers, extra flags, extra deps, extra libs]
all_modules = [
@ -44,8 +46,6 @@ all_modules = [
[ 'module-rescue-streams', 'module-rescue-streams.c' ],
[ 'module-role-cork', ['module-role-cork.c', 'stream-interaction.c'], 'stream-interaction.h' ],
[ 'module-role-ducking', ['module-role-ducking.c', 'stream-interaction.c'], 'stream-interaction.h' ],
[ 'module-rtp-recv', 'rtp/module-rtp-recv.c', [], [], [], librtp ],
[ 'module-rtp-send', 'rtp/module-rtp-send.c' , [], [], [], librtp ],
[ 'module-simple-protocol-tcp', 'module-protocol-stub.c', [], ['-DUSE_PROTOCOL_SIMPLE', '-DUSE_TCP_SOCKETS'], [], libprotocol_simple ],
[ 'module-simple-protocol-unix', 'module-protocol-stub.c', [], ['-DUSE_PROTOCOL_SIMPLE', '-DUSE_UNIX_SOCKETS'], [], libprotocol_simple ],
[ 'module-sine', 'module-sine.c' ],
@ -62,9 +62,23 @@ all_modules = [
[ 'module-virtual-sink', 'module-virtual-sink.c' ],
[ 'module-virtual-source', 'module-virtual-source.c' ],
[ 'module-volume-restore', 'module-volume-restore.c' ],
# [ 'module-waveout', 'module-waveout.c' ],
]
if host_machine.system() == 'windows'
winmm_dep = meson.get_compiler('c').find_library('winmm')
ksuser_dep = meson.get_compiler('c').find_library('ksuser')
all_modules += [
[ 'module-waveout', 'module-waveout.c', [], [], [winmm_dep, ksuser_dep] ],
]
endif
if host_machine.system() != 'windows'
all_modules += [
[ 'module-rtp-recv', 'rtp/module-rtp-recv.c', [], [], [], librtp ],
[ 'module-rtp-send', 'rtp/module-rtp-send.c' , [], [], [], librtp ],
]
endif
# Modules enabled by headers
if cc.has_header('linux/input.h')
@ -176,10 +190,13 @@ if lirc_dep.found()
endif
if openssl_dep.found()
subdir('raop')
all_modules += [
[ 'module-raop-sink', 'raop/module-raop-sink.c', [], [], [], libraop ],
]
if host_machine.system() != 'windows'
subdir('raop')
all_modules += [
[ 'module-raop-sink', 'raop/module-raop-sink.c', [], [], [], libraop ],
]
endif
if avahi_dep.found()
all_modules += [
[ 'module-raop-discover', 'raop/module-raop-discover.c', [], [], [avahi_dep], libavahi_wrap ],
@ -289,7 +306,7 @@ foreach m : all_modules
install : true,
install_rpath : rpath_dirs,
install_dir : modlibexecdir,
dependencies : [thread_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep, libintl_dep] + extra_deps,
dependencies : [thread_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep, libintl_dep, platform_dep, platform_socket_dep] + extra_deps,
link_args : [nodelete_link_args, '-Wl,--no-undefined' ],
link_with : extra_libs,
name_prefix : '',

View file

@ -83,7 +83,7 @@ libpulse = shared_library('pulse',
link_args : [nodelete_link_args, versioning_link_args],
install : true,
install_rpath : privlibdir,
dependencies : [libm_dep, thread_dep, libpulsecommon_dep, dbus_dep, dl_dep, iconv_dep, libintl_dep],
dependencies : [libm_dep, thread_dep, libpulsecommon_dep, dbus_dep, dl_dep, iconv_dep, libintl_dep, platform_dep, platform_socket_dep],
implicit_include_directories : false)
libpulse_dep = declare_dependency(link_with: libpulse)

View file

@ -182,11 +182,13 @@ libpulsecore_simd = simd.check('libpulsecore_simd',
libpulsecore_simd_lib = libpulsecore_simd[0]
cdata.merge_from(libpulsecore_simd[1])
# FIXME: Implement Windows support
#'mutex-win32.c',
#'poll-win32.c',
#'semaphore-win32.c',
#'thread-win32.c',
if host_machine.system() == 'windows'
libpulsecore_sources += ['mutex-win32.c',
'poll-win32.c',
'semaphore-win32.c',
'thread-win32.c',
]
endif
libpulsecore = shared_library('pulsecore-' + pa_version_major_minor,
libpulsecore_sources, libpulsecore_headers,
@ -198,7 +200,7 @@ libpulsecore = shared_library('pulsecore-' + pa_version_major_minor,
install_rpath : privlibdir,
install_dir : privlibdir,
link_with : libpulsecore_simd_lib,
dependencies : [libm_dep, libpulsecommon_dep, ltdl_dep, shm_dep, sndfile_dep, database_dep, dbus_dep, libatomic_ops_dep, orc_dep, samplerate_dep, soxr_dep, speex_dep, x11_dep, libintl_dep],
dependencies : [libm_dep, libpulsecommon_dep, ltdl_dep, shm_dep, sndfile_dep, database_dep, dbus_dep, libatomic_ops_dep, orc_dep, samplerate_dep, soxr_dep, speex_dep, x11_dep, libintl_dep, platform_dep, platform_socket_dep,],
implicit_include_directories : false)
libpulsecore_dep = declare_dependency(link_with: libpulsecore)

View file

@ -19,12 +19,14 @@ executable('pacat',
c_args : pa_c_args,
)
foreach alias : pacat_aliases
# FIXME How to handle extension (.exe on windows)?
dst = join_paths(bindir, alias)
cmd = 'ln -fs @0@ $DESTDIR@1@'.format('pacat', dst)
meson.add_install_script('sh', '-c', cmd)
endforeach
# Windows doesn't support symbolic links.
if host_machine.system() != 'windows'
foreach alias : pacat_aliases
dst = join_paths(bindir, alias)
cmd = 'ln -fs @0@ $DESTDIR@1@'.format('pacat', dst)
meson.add_install_script('sh', '-c', cmd)
endforeach
endif
pactl_sources = [
'pactl.c',
@ -40,33 +42,35 @@ executable('pactl',
c_args : pa_c_args,
)
pasuspender_sources = [
'pasuspender.c',
]
if host_machine.system() != 'windows'
pasuspender_sources = [
'pasuspender.c',
]
executable('pasuspender',
pasuspender_sources,
install: true,
install_rpath : privlibdir,
include_directories : [configinc, topinc],
link_with : [libpulsecommon, libpulse],
dependencies: [libintl_dep],
c_args : pa_c_args,
)
executable('pasuspender',
pasuspender_sources,
install: true,
install_rpath : privlibdir,
include_directories : [configinc, topinc],
link_with : [libpulsecommon, libpulse],
dependencies: [libintl_dep],
c_args : pa_c_args,
)
pacmd_sources = [
'pacmd.c',
]
pacmd_sources = [
'pacmd.c',
]
executable('pacmd',
pacmd_sources,
install: true,
install_rpath : privlibdir,
include_directories : [configinc, topinc],
link_with : [libpulsecommon, libpulse],
dependencies: [libintl_dep],
c_args : pa_c_args,
)
executable('pacmd',
pacmd_sources,
install: true,
install_rpath : privlibdir,
include_directories : [configinc, topinc],
link_with : [libpulsecommon, libpulse],
dependencies: [libintl_dep],
c_args : pa_c_args,
)
endif
if x11_dep.found()
pax11publish_sources = [