build_output.sh 819 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/bash
  2. echo "Building ${PKG_NAME}."
  3. # Isolate the build.
  4. mkdir build && cd build
  5. if [[ "$PKG_NAME" == *static ]]; then
  6. CARES_STATIC=ON
  7. CARES_SHARED=OFF
  8. else
  9. CARES_STATIC=OFF
  10. CARES_SHARED=ON
  11. fi
  12. if [[ "${target_platform}" == linux-* ]]; then
  13. CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_AR=${AR}"
  14. fi
  15. # Generate the build files.
  16. echo "Generating the build files..."
  17. cmake ${CMAKE_ARGS} -G"$CMAKE_GENERATOR" \
  18. -DCMAKE_BUILD_TYPE=Release \
  19. -DCMAKE_INSTALL_PREFIX="$PREFIX" \
  20. -DCARES_STATIC=${CARES_STATIC} \
  21. -DCARES_SHARED=${CARES_SHARED} \
  22. -DCARES_INSTALL=ON \
  23. -DCMAKE_INSTALL_LIBDIR=lib \
  24. -GNinja \
  25. ${SRC_DIR}
  26. # Build.
  27. echo "Building..."
  28. ninja || exit 1
  29. # Installing
  30. echo "Installing..."
  31. ninja install || exit 1
  32. # Error free exit!
  33. echo "Error free exit!"
  34. exit 0