Skip to content

Commit

Permalink
Merge pull request #4128 from openscad/wasm-update
Browse files Browse the repository at this point in the history
Add flags for WASM compilation.
  • Loading branch information
t-paul committed Feb 18, 2022
2 parents e03695a + f12a181 commit 755ffce
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Expand Up @@ -53,6 +53,7 @@ option(EXPERIMENTAL "Enable Experimental Features" OFF)
option(SNAPSHOT "Create dev snapshot, uses nightly icons" OFF)
option(HEADLESS "Build without GUI frontend" OFF)
option(ENABLE_EGL "Enable EGL instead of GLX support if available" OFF)
option(WASM "Build WebAssembly, (implies NULLGL=ON) " OFF)
option(NULLGL "Build without OpenGL, (implies HEADLESS=ON) " OFF)
option(IDPREFIX "Prefix CSG nodes with index # (debugging purposes only, will break node cache)" OFF)
option(PROFILE "Enable compiling with profiling / test coverage instrumentation" OFF)
Expand All @@ -77,7 +78,14 @@ if(PROFILE)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_COVERAGE_LINK_FLAGS}")
endif()

if (NULLGL)
if(WASM)
set(NULLGL ON)
set(ENV{PKG_CONFIG_PATH} "/emsdk/upstream/emscripten/cache/sysroot/lib/pkgconfig")
target_compile_options(OpenSCAD PRIVATE "-pthread")
target_compile_definitions(OpenSCAD PRIVATE CGAL_DISABLE_ROUNDING_MATH_CHECK)
endif()

if(NULLGL)
set(HEADLESS ON)
endif()
if(EXPERIMENTAL)
Expand Down

0 comments on commit 755ffce

Please sign in to comment.