build portaudio directly to support ASIO

This commit is contained in:
Anthony Samms
2025-09-16 01:18:25 -04:00
parent 02dc2fac95
commit d537f19a1c
2 changed files with 25 additions and 2 deletions

View File

@@ -25,7 +25,6 @@ jobs:
brew update brew update
brew install portaudio libsndfile libsamplerate pkg-config brew install portaudio libsndfile libsamplerate pkg-config
# Use MSYS2 for Windows audio library build with all codec dependencies
- name: Set up MSYS2 (Windows) - name: Set up MSYS2 (Windows)
if: runner.os == 'Windows' if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2 uses: msys2/setup-msys2@v2
@@ -44,6 +43,30 @@ jobs:
mingw-w64-x86_64-mpg123 mingw-w64-x86_64-mpg123
mingw-w64-x86_64-lame mingw-w64-x86_64-lame
mingw-w64-x86_64-speex mingw-w64-x86_64-speex
mingw-w64-x86_64-cmake
- name: Build PortAudio with ASIO (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
# Download PortAudio source
curl -L http://files.portaudio.com/archives/pa_stable_v190700_20210406.tgz -o portaudio.tgz
tar -xzf portaudio.tgz
cd portaudio
# Configure with ASIO support
mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DPA_USE_ASIO=ON \
-DPA_USE_DS=ON \
-DPA_USE_WMME=ON \
-DPA_USE_WASAPI=ON \
-DCMAKE_INSTALL_PREFIX=/mingw64
# Build and install
make -j$(nproc)
make install
- name: Build static audio library (Windows) - name: Build static audio library (Windows)
if: runner.os == 'Windows' if: runner.os == 'Windows'

View File

@@ -18,7 +18,7 @@ endef
ifneq (,$(findstring MINGW,$(UNAME_S))) ifneq (,$(findstring MINGW,$(UNAME_S)))
CC = x86_64-w64-mingw32-gcc CC = x86_64-w64-mingw32-gcc
LIBNAME = libaudio.dll LIBNAME = libaudio.dll
CFLAGS = -Wall -Wextra -O3 -fPIC -std=c99 -I/mingw64/include -m64 CFLAGS = -Wall -Wextra -O3 -fPIC -std=c99 -I/mingw64/include -m64 -DPA_USE_ASIO=1
LDFLAGS = -shared -Wl,--export-all-symbols -static-libgcc -static-libstdc++ -L/mingw64/lib -m64 LDFLAGS = -shared -Wl,--export-all-symbols -static-libgcc -static-libstdc++ -L/mingw64/lib -m64
# Core libraries with full dependency chain (order is critical!) # Core libraries with full dependency chain (order is critical!)