Separate GLSLANG_WEB (min-size build) and Emscripten options
Allows building non-min-size builds with Emscripten. Adds ENABLE_GLSLANG_WEB_DEVEL. Moves the glslang.js files to OSDependent/Web. Small cleanups and docs update.
This commit is contained in:
parent
be467db7bd
commit
4391924ac5
7 changed files with 70 additions and 62 deletions
|
|
@ -6,6 +6,10 @@ else(WIN32)
|
|||
message("unknown platform")
|
||||
endif(WIN32)
|
||||
|
||||
if(EMSCRIPTEN OR ENABLE_GLSLANG_WEB)
|
||||
add_subdirectory(OSDependent/Web)
|
||||
endif(EMSCRIPTEN OR ENABLE_GLSLANG_WEB)
|
||||
|
||||
set(SOURCES
|
||||
MachineIndependent/glslang.m4
|
||||
MachineIndependent/glslang.y
|
||||
|
|
@ -114,16 +118,3 @@ if(ENABLE_GLSLANG_INSTALL)
|
|||
install(FILES ${file} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/glslang/${dir})
|
||||
endforeach()
|
||||
endif(ENABLE_GLSLANG_INSTALL)
|
||||
|
||||
if(ENABLE_GLSLANG_WEB)
|
||||
add_executable(glslang.js glslang.js.cpp)
|
||||
glslang_set_link_args(glslang.js)
|
||||
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\"")
|
||||
em_link_pre_js(glslang.js ${CMAKE_CURRENT_SOURCE_DIR}/glslang.pre.js)
|
||||
endif(EMSCRIPTEN)
|
||||
endif(ENABLE_GLSLANG_WEB)
|
||||
|
|
|
|||
10
glslang/OSDependent/Web/CMakeLists.txt
Normal file
10
glslang/OSDependent/Web/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
add_executable(glslang.js "glslang.js.cpp")
|
||||
glslang_set_link_args(glslang.js)
|
||||
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\"")
|
||||
em_link_pre_js(glslang.js "${CMAKE_CURRENT_SOURCE_DIR}/glslang.pre.js")
|
||||
endif(EMSCRIPTEN)
|
||||
|
|
@ -35,17 +35,16 @@
|
|||
|
||||
#include <cstdio>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
#include <emscripten.h>
|
||||
#endif // __EMSCRIPTEN__
|
||||
#include <memory>
|
||||
#endif
|
||||
|
||||
#include "../SPIRV/GlslangToSpv.h"
|
||||
#include "../SPIRV/doc.h"
|
||||
#include "./../glslang/Public/ShaderLang.h"
|
||||
#include "../../../SPIRV/GlslangToSpv.h"
|
||||
#include "../../../glslang/Public/ShaderLang.h"
|
||||
|
||||
#ifndef EMSCRIPTEN_KEEPALIVE
|
||||
#ifndef __EMSCRIPTEN__
|
||||
#define EMSCRIPTEN_KEEPALIVE
|
||||
#endif
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/bash
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$1" = 'web' ]
|
||||
then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue