Skip to content

Commit

Permalink
Add allocate function as emscripten dep
Browse files Browse the repository at this point in the history
Web version crashes when you try to make a constraint. After debugging,
addressed the issue with this PR. Emscripten does some optimization
stuff and ends up dropping certain functions, including the alloacte
function called in solvespace's C++ Unwrap method.

To reproduce/test bug:
- Open the web version
- Create a rectangle
- Create a length constraint on one the rectangle edges
  • Loading branch information
dgramop authored and phkahler committed Dec 8, 2023
1 parent 94618d4 commit 3e5f983
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmake/Platform/Emscripten.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)

# FIXME(emscripten): Suppress non-c-typedef-for-linkage warnings in solvespace.h
add_compile_options(-Wno-non-c-typedef-for-linkage)

add_link_options(-s EXPORTED_RUNTIME_METHODS=[allocate])

# Enable optimization. Workaround for "too many locals" error when runs on browser.
if(CMAKE_BUILD_TYPE STREQUAL Release)
Expand Down

0 comments on commit 3e5f983

Please sign in to comment.