build_c.sh 593 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. # Isolate the build.
  3. mkdir -p build
  4. cd build || exit 1
  5. if [[ "$PKG_NAME" == *static ]]; then
  6. BUILD_TYPE="-DBUILD_SHARED_LIBS=OFF"
  7. else
  8. BUILD_TYPE="-DBUILD_SHARED_LIBS=ON"
  9. fi
  10. # Generate the build files.
  11. cmake -G "Ninja" \
  12. ${CMAKE_ARGS} \
  13. ${BUILD_TYPE} \
  14. -DCMAKE_BUILD_TYPE=Release \
  15. -DCMAKE_INSTALL_PREFIX=$PREFIX \
  16. -DCMAKE_INSTALL_LIBDIR=lib \
  17. -DREPROC_TEST=ON \
  18. ${SRC_DIR}
  19. # Build, test, and install.
  20. ninja || exit 1
  21. if [[ "$CONDA_BUILD_CROSS_COMPILATION" != "1" ]]; then
  22. ninja test || exit 1
  23. fi
  24. ninja install || exit 1