mempressure.cmake raw

   1  # Copyright (c) 2025-present The Limenka Knots developers
   2  # Distributed under the MIT software license, see the accompanying
   3  # file COPYING or https://opensource.org/license/mit/.
   4  
   5  include(CheckCXXSourceCompiles)
   6  
   7  check_cxx_source_compiles([[
   8    #include <sys/sysinfo.h>
   9  
  10    int main()
  11    {
  12      struct sysinfo info;
  13      int rv = sysinfo(&info);
  14      unsigned long test = info.freeram + info.bufferram + info.mem_unit;
  15      return test + rv;
  16    }
  17    ]] HAVE_LINUX_SYSINFO
  18  )
  19