Skip to content

Commit

Permalink
Add portable WASM version of funcfiftlib
Browse files Browse the repository at this point in the history
  • Loading branch information
krigga committed Mar 27, 2024
1 parent dd5540d commit 84a79fc
Showing 1 changed file with 21 additions and 0 deletions.
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

0 comments on commit 84a79fc

Please sign in to comment.