use custom es6 modularization instead of MODULARIZE=1
This commit is contained in:
parent
4391924ac5
commit
230117a02c
3 changed files with 42 additions and 11 deletions
|
|
@ -4,7 +4,21 @@ target_link_libraries(glslang.js glslang SPIRV)
|
|||
if(EMSCRIPTEN)
|
||||
set_target_properties(glslang.js PROPERTIES
|
||||
OUTPUT_NAME "glslang"
|
||||
SUFFIX ".js"
|
||||
LINK_FLAGS "--bind -s EXPORT_NAME=\"glslangModule\"")
|
||||
SUFFIX ".js")
|
||||
em_link_pre_js(glslang.js "${CMAKE_CURRENT_SOURCE_DIR}/glslang.pre.js")
|
||||
|
||||
target_link_options(glslang.js PRIVATE
|
||||
"SHELL:--bind -s MODULARIZE=1")
|
||||
if(ENABLE_EMSCRIPTEN_ENVIRONMENT_NODE)
|
||||
target_link_options(glslang.js PRIVATE
|
||||
"SHELL:-s ENVIRONMENT=node -s BINARYEN_ASYNC_COMPILATION=0")
|
||||
else()
|
||||
target_link_options(glslang.js PRIVATE
|
||||
"SHELL:-s ENVIRONMENT=web,worker")
|
||||
endif()
|
||||
|
||||
if(NOT ENABLE_EMSCRIPTEN_ENVIRONMENT_NODE)
|
||||
add_custom_command(TARGET glslang.js POST_BUILD
|
||||
COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/glslang.after.js >> ${CMAKE_CURRENT_BINARY_DIR}/glslang.js)
|
||||
endif()
|
||||
endif(EMSCRIPTEN)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue