fix cjson compile issues

This commit is contained in:
ading2210 2024-01-03 22:46:02 -05:00
parent e030ca6712
commit e695b1d14a
6 changed files with 47 additions and 24 deletions

View file

@ -8,19 +8,15 @@ CACERT_FILE="cacert.pem"
OUT_FILE="out/libcurl.js"
EXPORTED_FUNCS="_main,_perform_request,_copy_bytes"
RUNTIME_METHODS="addFunction,removeFunction"
COMPILER_OPTIONS="-o $OUT_FILE -lcurl -lssl -lcrypto -I $INCLUDE_DIR -L $LIB_DIR"
RUNTIME_METHODS="addFunction,removeFunction,allocate"
COMPILER_OPTIONS="-o $OUT_FILE -lcurl -lssl -lcrypto -lcjson -I $INCLUDE_DIR -L $LIB_DIR"
EMSCRIPTEN_OPTIONS="-lwebsocket.js -sWEBSOCKET_URL=wss://debug.ading.dev/ws -sASYNCIFY -sALLOW_TABLE_GROWTH -sEXPORTED_FUNCTIONS=$EXPORTED_FUNCS -sEXPORTED_RUNTIME_METHODS=$RUNTIME_METHODS --preload-file $CACERT_FILE"
if [ ! -f $CACERT_FILE ]; then
wget "https://curl.se/ca/cacert.pem" -O $CACERT_FILE
fi
if [ ! -d $INCLUDE_DIR ]; then
mkdir -p build
tools/openssl.sh
tools/curl.sh
fi
tools/all_deps.sh
mkdir -p out
COMPILE_CMD="emcc main.c $COMPILER_OPTIONS $EMSCRIPTEN_OPTIONS"