srsran: fix CPU option selection, split output (#376963)

This commit is contained in:
Markus Kowalewski 2025-01-26 14:56:26 +01:00 committed by GitHub
commit d5d087e0c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,6 +14,10 @@
soapysdr-with-plugins,
libbladeRF,
zeromq,
enableAvx ? stdenv.hostPlatform.avxSupport,
enableAvx2 ? stdenv.hostPlatform.avx2Support,
enableFma ? stdenv.hostPlatform.fmaSupport,
enableAvx512 ? stdenv.hostPlatform.avx512Support,
}:
stdenv.mkDerivation rec {
@ -27,6 +31,11 @@ stdenv.mkDerivation rec {
sha256 = "sha256-3cQMZ75I4cyHpik2d/eBuzw7M4OgbKqroCddycw4uW8=";
};
outputs = [
"out"
"dev"
];
nativeBuildInputs = [
cmake
pkg-config
@ -45,7 +54,17 @@ stdenv.mkDerivation rec {
zeromq
];
cmakeFlags = [ "-DENABLE_WERROR=OFF" ];
cmakeFlags = [
"-DENABLE_WERROR=OFF"
(lib.cmakeBool "ENABLE_AVX" enableAvx)
(lib.cmakeBool "ENABLE_AVX2" enableAvx2)
(lib.cmakeBool "ENABLE_FMA" enableFma)
(lib.cmakeBool "ENABLE_AVX512" enableAvx512)
];
postInstall = lib.optionalString (!stdenv.hostPlatform.isStatic) ''
rm $out/lib/*.a
'';
meta = with lib; {
homepage = "https://www.srslte.com/";