enable build for node

This commit is contained in:
Kai Ninomiya 2019-08-14 17:30:14 -07:00
parent 95609e6d92
commit a91561d583

View File

@ -33,6 +33,7 @@ option(ENABLE_NV_EXTENSIONS "Enables support of Nvidia-specific extensions" ON)
option(ENABLE_GLSLANG_WEB "Reduces glslang to minumum needed for web use" OFF)
option(ENABLE_EMSCRIPTEN_SINGLE_FILE "If using emscripten, enables SINGLE_FILE build" OFF)
option(ENABLE_EMSCRIPTEN_ENVIRONMENT_NODE "If using emscripten, builds to run on Node instead of Web" OFF)
CMAKE_DEPENDENT_OPTION(ENABLE_HLSL "Enables HLSL input support" ON "NOT ENABLE_GLSLANG_WEB" OFF)
@ -113,13 +114,20 @@ if(ENABLE_GLSLANG_WEB)
add_link_options("SHELL: -s FILESYSTEM=0")
add_link_options("SHELL: --llvm-lto 1")
add_link_options("SHELL: --closure 1")
add_link_options("SHELL: -s ENVIRONMENT=web,worker")
add_link_options("SHELL: -s ALLOW_MEMORY_GROWTH=1")
add_link_options("SHELL: -s MODULARIZE=1")
if(ENABLE_EMSCRIPTEN_SINGLE_FILE)
add_link_options("SHELL: -s SINGLE_FILE=1")
endif(ENABLE_EMSCRIPTEN_SINGLE_FILE)
if(ENABLE_EMSCRIPTEN_ENVIRONMENT_NODE)
add_link_options("SHELL: -s ENVIRONMENT=node")
add_link_options("SHELL: -s BINARYEN_ASYNC_COMPILATION=0")
else()
add_link_options("SHELL: -s ENVIRONMENT=web,worker")
add_link_options("SHELL: -s EXPORT_ES6=1")
endif()
else()
if(MSVC)
add_compile_options(/Os /GR-)