Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create another funcfiftlib WASM target #945

Open
wants to merge 2 commits into
base: testnet
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assembly/wasm/fift-func-wasm-build-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ emcmake cmake -DUSE_EMSCRIPTEN=ON -DCMAKE_BUILD_TYPE=Release \
test $? -eq 0 || { echo "Can't configure TON with emmake "; exit 1; }
cp -R ../crypto/smartcont ../crypto/fift/lib crypto

emmake make -j16 funcfiftlib func fift tlbc emulator-emscripten
emmake make -j16 funcfiftlib funcfiftlib-portable func fift tlbc emulator-emscripten

test $? -eq 0 || { echo "Can't compile TON with emmake "; exit 1; }

Expand Down
21 changes: 21 additions & 0 deletions crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,27 @@ if (USE_EMSCRIPTEN)
target_link_options(funcfiftlib PRIVATE --pre-js ${CMAKE_CURRENT_SOURCE_DIR}/funcfiftlib/funcfiftlib-prejs.js)
target_link_options(funcfiftlib PRIVATE -fexceptions)
target_compile_options(funcfiftlib PRIVATE -fexceptions -fno-stack-protector)

add_executable(funcfiftlib-portable funcfiftlib/funcfiftlib.cpp ${FUNC_LIB_SOURCE})
target_include_directories(funcfiftlib-portable PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_link_libraries(funcfiftlib-portable PUBLIC fift-lib src_parser git)
target_link_options(funcfiftlib-portable PRIVATE -sEXPORTED_RUNTIME_METHODS=FS,ccall,cwrap,UTF8ToString,stringToUTF8,lengthBytesUTF8,addFunction,removeFunction,setValue)
target_link_options(funcfiftlib-portable PRIVATE -sEXPORTED_FUNCTIONS=_func_compile,_version,_malloc,_free,_setThrew)
target_link_options(funcfiftlib-portable PRIVATE -sEXPORT_NAME=CompilerModule)
target_link_options(funcfiftlib-portable PRIVATE -sERROR_ON_UNDEFINED_SYMBOLS=0)
target_link_options(funcfiftlib-portable PRIVATE -sFILESYSTEM=1)
target_link_options(funcfiftlib-portable PRIVATE -Oz)
target_link_options(funcfiftlib-portable PRIVATE -sIGNORE_MISSING_MAIN=1)
target_link_options(funcfiftlib-portable PRIVATE -sAUTO_NATIVE_LIBRARIES=0)
target_link_options(funcfiftlib-portable PRIVATE -sMODULARIZE=1)
target_link_options(funcfiftlib-portable PRIVATE -sTOTAL_MEMORY=33554432)
target_link_options(funcfiftlib-portable PRIVATE -sALLOW_MEMORY_GROWTH=1)
target_link_options(funcfiftlib-portable PRIVATE -sALLOW_TABLE_GROWTH=1)
target_link_options(funcfiftlib-portable PRIVATE --embed-file ${CMAKE_CURRENT_SOURCE_DIR}/fift/lib@/fiftlib)
target_link_options(funcfiftlib-portable PRIVATE --pre-js ${CMAKE_CURRENT_SOURCE_DIR}/funcfiftlib/funcfiftlib-prejs.js)
target_link_options(funcfiftlib-portable PRIVATE -sENVIRONMENT=web)
target_link_options(funcfiftlib-portable PRIVATE -fexceptions)
target_compile_options(funcfiftlib-portable PRIVATE -fexceptions -fno-stack-protector)
endif()

add_executable(tlbc tl/tlbc.cpp)
Expand Down