wasm-build 1000 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/usr/bin/env bash
  2. # Copyright Materialize, Inc. and contributors. All rights reserved.
  3. #
  4. # Use of this software is governed by the Business Source License
  5. # included in the LICENSE file at the root of this repository.
  6. #
  7. # As of the Change Date specified in that file, in accordance with
  8. # the Business Source License, use of this software will be governed
  9. # by the Apache License, Version 2.0.
  10. #
  11. # wasm-build — build a crate for WASM32
  12. set -euo pipefail
  13. . misc/shlib/shlib.bash
  14. # Unset existing flags because several linker-specific ones don't play nicely with WASM targets
  15. export RUSTFLAGS="--cfg=tokio_unstable"
  16. if [[ $# -lt 1 ]]
  17. then
  18. echo "usage: $0 <path>
  19. Builds a WASM32 target and NPM metadata for the specified crate
  20. path the path to the crate"
  21. exit 1
  22. fi
  23. crate=$1
  24. exec "$(dirname "$0")"/xcompile \
  25. tool \
  26. --no-name-target-prefix \
  27. wasm-pack \
  28. build \
  29. --release \
  30. --scope materializeinc \
  31. "$crate" \
  32. -- \
  33. --no-default-features