fix JACK host API build for MSVC and MinGW (#618)
* JACK: initialize JACK host API on Windows * GH Actions: build JACK host API with MinGW and MSVC using vcpkg I was not able to get Ubuntu MinGW to build with JACK. I got different link errors with every combination of static/dynamic JACK/PortAudio. Also switch to installing JACK from vcpkg for Ubuntu and macOS for consistency.
This commit is contained in:
parent
758a78a02c
commit
a01a54b7c9
|
@ -15,15 +15,19 @@ jobs:
|
|||
- name: Ubuntu GCC
|
||||
os: ubuntu-latest
|
||||
install_dir: ~/portaudio
|
||||
dependencies_extras: libjack-dev
|
||||
vcpkg_triplet: x64-linux
|
||||
cmake_generator: "Unix Makefiles"
|
||||
cmake_options:
|
||||
-DOSS=ON
|
||||
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
|
||||
- name: Ubuntu MinGW
|
||||
os: ubuntu-latest
|
||||
install_dir: ~/portaudio
|
||||
asio_sdk_cache_path: asiosdk.zip
|
||||
dependencies_extras: mingw-w64
|
||||
# FIXME: linking JACK fails with vcpkg. Switch the CMake toolchain file to use vcpkg. The
|
||||
# toolchain file in this repository is not needed when using a MinGW triplet with vcpkg.
|
||||
vcpkg_triplet: x64-mingw-static
|
||||
cmake_generator: "Unix Makefiles"
|
||||
cmake_options:
|
||||
-DASIO=ON
|
||||
|
@ -32,35 +36,45 @@ jobs:
|
|||
- name: Windows MSVC
|
||||
os: windows-latest
|
||||
install_dir: C:\portaudio
|
||||
vcpkg_triplet: x64-windows
|
||||
cmake_generator: "Visual Studio 16 2019"
|
||||
# ASIO_SDK_ZIP_PATH needs to be quoted or CMake will save the download to
|
||||
# asiosdk instead of asiosdk.zip.
|
||||
asio_sdk_cache_path: "asiosdk.zip"
|
||||
# Somehow CMake fails to find the toolchain file if a relative path is used on Windows.
|
||||
cmake_options:
|
||||
-DASIO=ON
|
||||
-DASIO_SDK_ZIP_PATH="asiosdk.zip"
|
||||
-DCMAKE_TOOLCHAIN_FILE=D:\a\portaudio\portaudio\vcpkg\scripts\buildsystems\vcpkg.cmake
|
||||
- name: Windows MinGW
|
||||
os: windows-latest
|
||||
install_dir: C:\portaudio
|
||||
vcpkg_triplet: x64-mingw-static
|
||||
cmake_generator: "MinGW Makefiles"
|
||||
# ASIO_SDK_ZIP_PATH needs to be quoted or CMake will save the download to
|
||||
# asiosdk instead of asiosdk.zip.
|
||||
asio_sdk_cache_path: "asiosdk.zip"
|
||||
# Somehow CMake fails to find the toolchain file if a relative path is used on Windows.
|
||||
cmake_options:
|
||||
-DASIO=ON
|
||||
-DASIO_SDK_ZIP_PATH="asiosdk.zip"
|
||||
-DCMAKE_TOOLCHAIN_FILE=D:\a\portaudio\portaudio\vcpkg\scripts\buildsystems\vcpkg.cmake
|
||||
- name: macOS Clang
|
||||
os: macOS-latest
|
||||
install_dir: ~/portaudio
|
||||
vcpkg_triplet: x64-osx
|
||||
cmake_generator: "Unix Makefiles"
|
||||
cmake_options:
|
||||
-DCMAKE_FRAMEWORK=OFF
|
||||
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
|
||||
- name: macOS Clang framework
|
||||
os: macOS-latest
|
||||
install_dir: ~/portaudio
|
||||
vcpkg_triplet: x64-osx
|
||||
cmake_generator: "Unix Makefiles"
|
||||
cmake_options:
|
||||
-DCMAKE_FRAMEWORK=ON
|
||||
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
name: ${{ matrix.name }}
|
||||
|
@ -69,27 +83,32 @@ jobs:
|
|||
steps:
|
||||
- name: checkout Git repository
|
||||
uses: actions/checkout@v2
|
||||
- name: "[Ubuntu] install ALSA and JACK headers"
|
||||
- name: "[Ubuntu] install dependencies"
|
||||
run: sudo apt-get install libasound2-dev ${{ matrix.dependencies_extras }}
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
- name: "[macOS] install JACK from Homebrew"
|
||||
run: brew install jack
|
||||
if: matrix.os == 'macOS-latest'
|
||||
- name: "[Windows MinGW] install MinGW from Chocolatey"
|
||||
run: choco install mingw
|
||||
if: startsWith(matrix.os, 'Windows MinGW')
|
||||
- name: "[Windows/MinGW] set up ASIO SDK cache"
|
||||
uses: actions/cache@v2
|
||||
if: matrix.asio_sdk_cache_path != null
|
||||
with:
|
||||
path: ${{ matrix.asio_sdk_cache_path }}
|
||||
key: ${{ hashFiles('.github/asiosdk-version.txt') }}
|
||||
- name: Setup vcpkg
|
||||
uses: lukka/run-vcpkg@v7
|
||||
if: ${{ matrix.vcpkg_triplet }} != null
|
||||
with:
|
||||
vcpkgTriplet: ${{ matrix.vcpkg_triplet }}
|
||||
appendedCacheKey: ${{ hashFiles( '**/vcpkg.json' ) }}
|
||||
additionalCachedPaths: build/vcpkg_installed
|
||||
vcpkgGitCommitId: 3ab8c7487451cc61c778258c92bd88dfe3c5f32e
|
||||
# Required when using vcpkg.json manifest in repository
|
||||
setupOnly: true
|
||||
- name: configure
|
||||
run: cmake
|
||||
-G "${{ matrix.cmake_generator }}"
|
||||
${{ matrix.cmake_options }}
|
||||
-DCMAKE_INSTALL_PREFIX=${{ matrix.install_dir }}
|
||||
-DCMAKE_BUILD_TYPE=${{ env.cmake_build_type }}
|
||||
-DVCPKG_TARGET_TRIPLET=${{ matrix.vcpkg_triplet }}
|
||||
-DSKELETON=ON
|
||||
-DBUILD_TESTING=ON
|
||||
-DBUILD_EXAMPLES=ON
|
||||
|
|
|
@ -63,6 +63,7 @@ PaError PaWinDs_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiInde
|
|||
PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index );
|
||||
PaError PaWinWdm_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index );
|
||||
PaError PaWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index );
|
||||
PaError PaJack_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -92,6 +93,10 @@ PaUtilHostApiInitializer *paHostApiInitializers[] =
|
|||
PaWinWdm_Initialize,
|
||||
#endif
|
||||
|
||||
#if PA_USE_JACK
|
||||
PaJack_Initialize,
|
||||
#endif
|
||||
|
||||
#if PA_USE_SKELETON
|
||||
PaSkeleton_Initialize, /* just for testing. last in list so it isn't marked as default. */
|
||||
#endif
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"name": "portaudio",
|
||||
"version": "19.8",
|
||||
"description": "PortAudio Portable Cross-platform Audio I/O API PortAudio is a free, cross-platform, open-source, audio I/O library. It lets you write simple audio programs in 'C' or C++ that will compile and run on many platforms including Windows, Macintosh OS X, and Unix (OSS/ALSA). It is intended to promote the exchange of audio software between developers on different platforms. Many applications use PortAudio for Audio I/O.",
|
||||
"homepage": "http://portaudio.com/",
|
||||
"license": "MIT",
|
||||
"supports": "!uwp",
|
||||
"default-features": [ "jack" ],
|
||||
"features": {
|
||||
"jack": {
|
||||
"description": "Build with support for the JACK Audio Connection Kit host API.",
|
||||
"dependencies": [
|
||||
"jack2",
|
||||
{
|
||||
"name": "tre",
|
||||
"platform": "windows | mingw"
|
||||
},
|
||||
{
|
||||
"name": "pthreads",
|
||||
"platform": "windows"
|
||||
}
|
||||
]
|
||||
},
|
||||
"asio": {
|
||||
"description": "Build with support for ASIO host API on Windows or MinGW. This automatically downloads the ASIO SDK from Steinberg. Review the ASIO SDK license for details https://www.steinberg.net/en/company/developers.html"
|
||||
}
|
||||
},
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue