Skip to content

Commit 16d1bd4

Browse files
committed
Added GLTFPP_AS_HTML flag to build system
1 parent 41938a1 commit 16d1bd4

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@ if(GLTFPP_ENABLE_MODULES AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND NOT
1818
endif()
1919
if(EMSCRIPTEN)
2020
option(GLTFPP_WEBASSEMBLY "Generate WebAssembly instead of asm.js" ON)
21+
option(GLTFPP_AS_HTML "Generate a HTML page with a terminal emulator" OFF)
2122
if(GLTFPP_WEBASSEMBLY)
2223
set(CMAKE_CXX_FLAGS "-s WASM=1 --bind")
2324
endif()
25+
if(GLTFPP_AS_HTML)
26+
set(CMAKE_EXECUTABLE_SUFFIX ".html")
27+
endif()
2428
endif()
2529

2630
find_package(Sphinx)

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Install emscripten, then invoke CMake via emconfigure:
2424
emconfigure cmake .. [-GNinja] [-DGLTFPP_WEBASSEMBLY=1] # Default is wasm instead of asm.js
2525
```
2626
Compiling to WebAssembly requires binaryen. Note that this library does not export anything, so you can't use it in the browser yet.
27+
By passing the flag `-DGLTFPP_AS_HTML=1`, emscripten generates a html page with a terminal emulator for each executable (read: the unit test runner).
2728

2829
Running the tests
2930
-----------------

0 commit comments

Comments
 (0)