Skip to content
Snippets Groups Projects
Commit d0d783e8 authored by Bartek Wrona's avatar Bartek Wrona
Browse files

Applied emscripten settings to generate and deploy separate .wasm file...

Applied emscripten settings to generate and deploy separate .wasm file (instead of embedding base64 string in generated JS code)
parent 33266766
No related branches found
No related tags found
1 merge request!260Typescript & toolset version update
...@@ -34,10 +34,18 @@ add_subdirectory( ${HIVE_ROOT_PATH}/libraries/schema build_schema_minimal ) ...@@ -34,10 +34,18 @@ add_subdirectory( ${HIVE_ROOT_PATH}/libraries/schema build_schema_minimal )
add_subdirectory( ${HIVE_ROOT_PATH}/libraries/protocol build_protocol_minimal ) add_subdirectory( ${HIVE_ROOT_PATH}/libraries/protocol build_protocol_minimal )
# Override common options specific to exception handling for **WHOLE SET OF HIVE SPECIFIC MODULES** # Override common options specific to exception handling for **WHOLE SET OF HIVE SPECIFIC MODULES**
TARGET_COMPILE_OPTIONS( CommonBuildOptions INTERFACE -fwasm-exceptions -Wall ) TARGET_COMPILE_OPTIONS( CommonBuildOptions INTERFACE -fwasm-exceptions -Wall
-Oz
#-gseparate-dwarf
#-gsplit-dwarf
)
TARGET_LINK_OPTIONS( CommonBuildOptions INTERFACE -fwasm-exceptions TARGET_LINK_OPTIONS( CommonBuildOptions INTERFACE -fwasm-exceptions
-Oz
-sEXPORT_EXCEPTION_HANDLING_HELPERS=1 -sEXPORT_EXCEPTION_HANDLING_HELPERS=1
-sEXCEPTION_STACK_TRACES=1 -sEXCEPTION_STACK_TRACES=1
-sELIMINATE_DUPLICATE_FUNCTIONS=1
#-gsource-map
#-gseparate-dwarf
) )
file(GLOB HEADERS "core/*.hpp") file(GLOB HEADERS "core/*.hpp")
...@@ -78,19 +86,27 @@ function( DEFINE_WAX_TARGET_FOR env ) ...@@ -78,19 +86,27 @@ function( DEFINE_WAX_TARGET_FOR env )
target_link_options( ${exec_wasm_name} PUBLIC target_link_options( ${exec_wasm_name} PUBLIC
-sMODULARIZE=1 -sMODULARIZE=1
-sSINGLE_FILE=1 -sSINGLE_FILE=0
-sEXPORT_ES6=1 -sEXPORT_ES6=1
-sUSE_ES6_IMPORT_META=0
-sINITIAL_MEMORY=67108864 -sINITIAL_MEMORY=67108864
--emit-symbol-map
# Decreases runtime performance for 50kB decrease in packed .tgz code size # Decreases runtime performance for 50kB decrease in packed .tgz code size
# --closure 1 # --closure 1
# -Os # -Os
) )
set_target_properties( ${exec_wasm_name} PROPERTIES OUTPUT_NAME "wax.${env}.js" ) set_target_properties( ${exec_wasm_name} PROPERTIES OUTPUT_NAME "wax.${env}.js" )
INSTALL( TARGETS ${exec_wasm_name} INSTALL( TARGETS ${exec_wasm_name}
COMPONENT "${exec_wasm_name}_runtime" COMPONENT "${exec_wasm_name}_runtime"
RUNTIME DESTINATION . RUNTIME DESTINATION .
) )
INSTALL( FILES "$<TARGET_FILE_DIR:${exec_wasm_name}>/wax.${env}.wasm"
COMPONENT "${exec_wasm_name}_runtime"
DESTINATION .
)
# Helper target, just to perform TypeScript wrapper generation # Helper target, just to perform TypeScript wrapper generation
ADD_EXECUTABLE( ${exec_ts_gen} ${SOURCES} ) ADD_EXECUTABLE( ${exec_ts_gen} ${SOURCES} )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment