From 0027a5035bde6839eee7a0f250abf2ac43897ba0 Mon Sep 17 00:00:00 2001 From: Jan Svabenik Date: Wed, 18 Mar 2026 13:48:40 +0100 Subject: [PATCH] Use cuda-mingw import libs when available --- build-sdrplay.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build-sdrplay.ps1 b/build-sdrplay.ps1 index fe270af..2f46e1f 100644 --- a/build-sdrplay.ps1 +++ b/build-sdrplay.ps1 @@ -24,16 +24,17 @@ if (-not (Test-Path $cudaInc)) { if (Test-Path $cudaInc) { $env:CGO_CFLAGS = "$env:CGO_CFLAGS -I$cudaInc" } -if (Test-Path $cudaLib) { - $env:CGO_LDFLAGS = "$env:CGO_LDFLAGS -L$cudaLib -lcufft -lcudart" -} if (Test-Path $cudaBin) { $env:PATH = "$cudaBin;" + $env:PATH } $cudaMingw = Join-Path $PSScriptRoot 'cuda-mingw' if (Test-Path $cudaMingw) { + # Use MinGW import libs to avoid MSVC .lib linking issues $env:CGO_LDFLAGS = "$env:CGO_LDFLAGS -L$cudaMingw" +} elseif (Test-Path $cudaLib) { + # Fallback to CUDA lib path (requires compatible toolchain) + $env:CGO_LDFLAGS = "$env:CGO_LDFLAGS -L$cudaLib -lcufft -lcudart" } Write-Host "Building with SDRplay + cuFFT support..." -ForegroundColor Cyan