Sha256: c00295ca6859dd954da5893610e8efdeb62210c6e7d5526a9a2f38d136f47ce6

Contents?: true

Size: 1.24 KB

Versions: 1581

Compression:

Stored size: 1.24 KB

Contents

#!/usr/bin/env bash
emcc_exists="$(command -v emcc)"
if [ ! "${emcc_exists}" ]; then
  echo "Emscripten not on path"
  exit 1
fi

set -e

cd "$1"
shift

# Parse arguments
while [ $# -gt 0 ]; do
  case $1 in
  --wasm-bigint) WASM_BIGINT=true ;;
  *)
    echo "ERROR: Unknown parameter: $1" >&2
    exit 1
    ;;
  esac
  shift
done


export CFLAGS="-fPIC -O2 -I../../target/include $EXTRA_CFLAGS"
export CXXFLAGS="$CFLAGS -sNO_DISABLE_EXCEPTION_CATCHING $EXTRA_CXXFLAGS"
export LDFLAGS=" \
    -L../../target/lib/ -lffi \
    -sEXPORT_ALL \
    -sMODULARIZE \
    -sMAIN_MODULE \
    -sNO_DISABLE_EXCEPTION_CATCHING \
    $EXTRA_LD_FLAGS \
"

# This needs to test false if there exists an environment variable called
# WASM_BIGINT whose contents are empty. Don't use +x.
if [ -n "${WASM_BIGINT}" ] ; then
  export LDFLAGS+=" -sWASM_BIGINT"
else
  export LDFLAGS+=" -sEXPORTED_RUNTIME_METHODS='getTempRet0,setTempRet0'"
fi

# Rename main functions to test__filename so we can link them together
ls *c | sed 's!\(.*\)\.c!sed -i "s/main/test__\1/g" \0!g' | bash

# Compile
ls *.c | sed 's/\(.*\)\.c/emcc $CFLAGS -c \1.c -o \1.o /g' | bash
ls *.cc | sed 's/\(.*\)\.cc/em++ $CXXFLAGS -c \1.cc -o \1.o /g' | bash

# Link
em++ $LDFLAGS *.o -o test.js
cp ../emscripten/test.html .

Version data entries

1,581 entries across 1,580 versions & 16 rubygems

Version Path
cybrid_api_organization_ruby-0.117.21 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh
affixapi-1.1.83 vendor/bundle/ruby/3.3.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh
cybrid_api_id_ruby-0.115.140 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh
cybrid_api_organization_ruby-0.115.140 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh
cybrid_api_id_ruby-0.115.139 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh
cybrid_api_bank_ruby-0.115.139 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh
cybrid_api_organization_ruby-0.115.139 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh
cybrid_api_id_ruby-0.115.138 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh
cybrid_api_organization_ruby-0.115.138 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh
ory-client-1.11.6 vendor/bundle/ruby/2.7.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh
cybrid_api_id_ruby-0.115.137 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh
cybrid_api_bank_ruby-0.115.137 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh
cybrid_api_organization_ruby-0.115.137 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh
cybrid_api_bank_ruby-0.115.135 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh
cybrid_api_organization_ruby-0.115.135 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh
cybrid_api_id_ruby-0.115.135 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh
cybrid_api_organization_ruby-0.115.134 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh
cybrid_api_bank_ruby-0.115.134 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh
cybrid_api_id_ruby-0.115.134 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh
cybrid_api_bank_ruby-0.115.133 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh