Skip to content

Commit 38889d3

Browse files
committed
CI: Use vcpkg's CMake integration to install dependencies.
1 parent 51ed006 commit 38889d3

3 files changed

Lines changed: 15 additions & 5 deletions

File tree

.github/workflows/build.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ jobs:
4141
include:
4242
- sys: {os: 'windows', shell: 'pwsh'}
4343
cmake_args: >-
44-
-DCMAKE_PREFIX_PATH=C:/vcpkg/installed/x64-windows
4544
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
4645
--install-prefix=$env:GITHUB_WORKSPACE/install
4746
- sys: {os: 'windows', shell: 'msys2'}
@@ -75,10 +74,6 @@ jobs:
7574
sudo apt install libfftw3-dev libusb-1.0-0-dev
7675
if: matrix.sys.os == 'ubuntu'
7776

78-
- name: Install dependencies (Windows)
79-
run: vcpkg install --triplet=x64-windows libusb fftw3 pthreads
80-
if: matrix.sys.os == 'windows' && matrix.sys.shell != 'msys2'
81-
8277
- name: Setup MSYS (Windows)
8378
if: matrix.sys.os == 'windows' && matrix.sys.shell == 'msys2'
8479
uses: msys2/setup-msys2@v2
@@ -132,6 +127,15 @@ jobs:
132127
cd host/hackrf-tools/build
133128
cmake .. -DCMAKE_BUILD_TYPE=Release ${{ matrix.cmake_args }}
134129
cmake --build . --config Release
130+
if: matrix.sys.shell != 'pwsh'
131+
132+
- name: Configure & Build (hackrf-tools, vcpkg)
133+
run: |
134+
cmake -E make_directory host/hackrf-tools/build
135+
cd host/hackrf-tools/build
136+
cmake .. -DCMAKE_BUILD_TYPE=Release ${{ matrix.cmake_args }} -DCMAKE_PREFIX_PATH=$env:GITHUB_WORKSPACE/install
137+
cmake --build . --config Release
138+
if: matrix.sys.shell == 'pwsh'
135139

136140
- name: Install (hackrf-tools)
137141
run: |

host/libhackrf/vcpkg.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"dependencies": ["libusb", "pthreads"]
3+
}

host/vcpkg.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"dependencies": ["libusb", "fftw3", "pthreads"]
3+
}

0 commit comments

Comments
 (0)