Unverified Commit d5d087e0 authored by Markus Kowalewski's avatar Markus Kowalewski Committed by GitHub
Browse files

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

parents ce603c22 5958dc9c
Loading
Loading
Loading
Loading
+20 −1
Original line number Diff line number Diff line
@@ -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/";