build.sh 712 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. if [[ $target_platform =~ linux.* ]]; then
  3. export LDFLAGS="$LDFLAGS -Wl,-rpath-link,$PREFIX/lib"
  4. fi
  5. # linux-aarch64 activations fails to set `ar` tool. This can be
  6. # removed when ctng-compiler-activation is corrected.
  7. if [[ "${target_platform}" == linux-aarch64 ]]; then
  8. if [[ -n "$AR" ]]; then
  9. CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_AR=${AR}"
  10. fi
  11. fi
  12. for _shared in OFF ON; do
  13. mkdir build-${_shared}
  14. pushd build-${_shared}
  15. cmake ${CMAKE_ARGS} \
  16. -DCMAKE_INSTALL_PREFIX=${PREFIX} \
  17. -DBUILD_SHARED_LIBS=${_shared} \
  18. -DCMAKE_INSTALL_LIBDIR=lib \
  19. ..
  20. make -j${CPU_COUNT} ${VERBOSE_CM}
  21. make install
  22. popd
  23. done