about summary refs log tree commit diff
path: root/pkgs/applications/radio/srsran
diff options
context:
space:
mode:
authorSergei Trofimovich <slyich@gmail.com>2024-02-24 22:51:02 +0000
committerSergei Trofimovich <slyich@gmail.com>2024-02-24 22:51:02 +0000
commitd50536f875b6cfaa0ee7d8c9b83206ea0c866b4a (patch)
treeaa25ee9cd33c6ce3d0da36cde4c6332c6fb2bd47 /pkgs/applications/radio/srsran
parentd6cc5bb41d95eafce820fe82035838312efeb0df (diff)
srsran: fix `gcc-13` build
Without the change build fails on `master` as
https://hydra.nixos.org/build/250334809:

    In file included from /build/source/srsue/hdr/phy/phy_metrics.h:26,
                     from /build/source/srsue/hdr/phy/phy_common.h:25,
                     from /build/source/srsue/src/phy/phy_common.cc:26:
    In member function 'std::array<_Tp, _Nm>::value_type& std::array<_Tp, _Nm>::operator[](size_type) [with _Tp = float; long unsigned int _Nm = 5]',
        inlined from 'void srsue::phy_common::reset_measurements(uint32_t)' at /build/source/srsue/src/phy/phy_common.cc:662:18,
        inlined from 'void srsue::phy_common::reset()' at /build/source/srsue/src/phy/phy_common.cc:918:21:
    /nix/store/qs1nwzbp2ml3cxzsxihn82hl0w73snr0-gcc-13.2.0/include/c++/13.2.0/array:203:24: error: array subscript 5 is above array bounds of 'std::__array_traits<float, 5>::_Type' {aka 'float [5]'} [-Werror=array-bounds=]
      203 |         return _M_elems[__n];
          |                ~~~~~~~~^

Blanket `-Werror` is prone to build failures on newer toolchains.
Disable it via exposed `cmake` configure knob.
Diffstat (limited to 'pkgs/applications/radio/srsran')
-rw-r--r--pkgs/applications/radio/srsran/default.nix2
1 files changed, 2 insertions, 0 deletions
diff --git a/pkgs/applications/radio/srsran/default.nix b/pkgs/applications/radio/srsran/default.nix
index a6745d2c406cc..5d03f9bcfdfb2 100644
--- a/pkgs/applications/radio/srsran/default.nix
+++ b/pkgs/applications/radio/srsran/default.nix
@@ -41,6 +41,8 @@ stdenv.mkDerivation rec {
     zeromq
   ];
 
+  cmakeFlags = [ "-DENABLE_WERROR=OFF" ];
+
   meta = with lib; {
     homepage = "https://www.srslte.com/";
     description = "Open-source 4G and 5G software radio suite.";