build_cpp.sh 683 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. # Isolate the build.
  3. mkdir -p build-cpp
  4. cd build-cpp || 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. echo "CMAKE_ARGS: ${CMAKE_ARGS}"
  12. echo "SRC_DIR: ${SRC_DIR}"
  13. cmake -G "Ninja" \
  14. ${CMAKE_ARGS} \
  15. ${BUILD_TYPE} \
  16. -DCMAKE_BUILD_TYPE=Release \
  17. -DCMAKE_INSTALL_PREFIX=$PREFIX \
  18. -DCMAKE_INSTALL_LIBDIR=lib \
  19. -DREPROC++=ON \
  20. -DREPROC_TEST=ON \
  21. ${SRC_DIR}
  22. # Build, test, and install.
  23. ninja || exit 1
  24. if [[ "$CONDA_BUILD_CROSS_COMPILATION" != "1" ]]; then
  25. ninja test || exit 1
  26. fi
  27. ninja install || exit 1