meson: Add DEF file to export APIs in Windows

This helps to export correct APIs for compiler toolchain which
does not support version script file. For example, mingw clang.
The APIs in libpulse.def are similar with map-file except those
are in pulse-simple and pulse-mainloop-glib. Those are exported
in different shared library in Windows platform.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/761>
This commit is contained in:
Biswapriyo Nath 2023-03-16 13:05:44 +05:30
parent 15e76a69bf
commit 39b6a4c123
3 changed files with 393 additions and 5 deletions

View file

@ -17,7 +17,14 @@ print_map_file() {
echo "};"
}
TARGET_FILE=$1
shift
print_def_file() {
echo "EXPORTS"
ctags -I ${CTAGS_IDENTIFIER_LIST} -f - --c-kinds=p "$@" | awk '/^pa_/ && !/(^pa_glib_|^pa_simple_)/ { print $1 }' | sort
}
cd "${MESON_SOURCE_ROOT}/${MESON_SUBDIR}" && print_map_file "$@" > ${TARGET_FILE}
MAP_FILE=$1
DEF_FILE=$2
shift 2
cd "${MESON_SOURCE_ROOT}/${MESON_SUBDIR}" && print_map_file "$@" > ${MAP_FILE}
cd "${MESON_SOURCE_ROOT}/${MESON_SUBDIR}" && print_def_file "$@" > ${DEF_FILE}