do_build.sh 862 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. set -e
  3. # performs a standard out-of-tree build and transform environment vars to cmake options
  4. # set RTLSDR=ON/OFF/AUTO (default: ON)
  5. # set SOAPYSDR=ON/OFF/AUTO (default: AUTO)
  6. # set CMAKE_TOOLCHAIN_FILE=file (default: unset)
  7. # set RUN_RTL_433_TESTS=1 (default: unset)
  8. RTLSDR="${RTLSDR:-ON}"
  9. SOAPYSDR="${SOAPYSDR:-AUTO}"
  10. set -- -DENABLE_RTLSDR=$RTLSDR -DENABLE_SOAPYSDR=$SOAPYSDR
  11. mkdir -p build
  12. cd build
  13. if [ -n "$CMAKE_TOOLCHAIN_FILE" ] ; then
  14. cmake $@ -DCMAKE_TOOLCHAIN_FILE=../$CMAKE_TOOLCHAIN_FILE ..
  15. else
  16. cmake $@ ..
  17. fi
  18. make
  19. # make install
  20. if [ -n "$RUN_RTL_433_TESTS" ] ; then
  21. cd ..
  22. set -x
  23. git clone --depth 1 https://github.com/merbanan/rtl_433_tests.git
  24. cd rtl_433_tests
  25. export PATH=../build/src:$PATH
  26. test -f ../build/src/rtl_433
  27. # virtualenv --system-site-packages .venv
  28. # source .venv/bin/activate
  29. # pip install deepdiff
  30. make test
  31. fi