mirror of
https://github.com/ading2210/libcurl.js.git
synced 2025-05-11 21:40:02 -04:00
build cjson for emscripten
This commit is contained in:
parent
2a511ff6e9
commit
e030ca6712
4 changed files with 46 additions and 1 deletions
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"clangd.fallbackFlags": [
|
||||
"-I/usr/share/emscripten/cache/sysroot/include/"
|
||||
"-I/usr/share/emscripten/cache/sysroot/include/",
|
||||
"-I/usr/lib/emscripten/system/include"
|
||||
]
|
||||
}
|
|
@ -22,6 +22,7 @@ if [ ! -d $INCLUDE_DIR ]; then
|
|||
tools/curl.sh
|
||||
fi
|
||||
|
||||
mkdir -p out
|
||||
COMPILE_CMD="emcc main.c $COMPILER_OPTIONS $EMSCRIPTEN_OPTIONS"
|
||||
echo $COMPILE_CMD
|
||||
$COMPILE_CMD
|
||||
|
|
16
client/tools/all_deps.sh
Executable file
16
client/tools/all_deps.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
#build all deps
|
||||
|
||||
mkdir -p build
|
||||
|
||||
OPENSSL_PREFIX=$(realpath build/openssl-wasm)
|
||||
CJSON_PREFIX=$(realpath build/cjson-wasm)
|
||||
CURL_PREFIX=$(realpath build/curl-wasm)
|
||||
|
||||
tools/openssl.sh
|
||||
tools/cjson.sh
|
||||
tools/curl.sh
|
||||
|
||||
cp -r $OPENSSL_PREFIX/* $CURL_PREFIX
|
||||
cp -r $CJSON_PREFIX/* $CURL_PREFIX
|
27
client/tools/cjson.sh
Executable file
27
client/tools/cjson.sh
Executable file
|
@ -0,0 +1,27 @@
|
|||
#!/bin/bash
|
||||
|
||||
#compile cjson for use with emscripten
|
||||
|
||||
set -x
|
||||
set -e
|
||||
|
||||
CORE_COUNT=$(nproc --all)
|
||||
PREFIX=$(realpath build/cjson-wasm)
|
||||
mkdir -p $PREFIX
|
||||
|
||||
cd build
|
||||
rm -rf cjson
|
||||
git clone -b master --depth=1 https://github.com/DaveGamble/cJSON cjson
|
||||
cd cjson
|
||||
|
||||
emmake make all
|
||||
INCLUDE_FILES="cJSON.h cJSON_Utils.h"
|
||||
LIB_FILES="libcjson.a libcjson_utils.a"
|
||||
|
||||
rm -rf $PREFIX
|
||||
mkdir -p $PREFIX/include/cjson
|
||||
mkdir -p $PREFIX/lib
|
||||
cp $INCLUDE_FILES $PREFIX/include/cjson
|
||||
cp $LIB_FILES $PREFIX/lib
|
||||
|
||||
cd ../../
|
Loading…
Add table
Add a link
Reference in a new issue