File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change 1+ message (STATUS "Building for Emscripten" )
12cmake_minimum_required (VERSION 3.10)
23project (libnest2d_js)
34
@@ -12,6 +13,22 @@ target_include_directories(libnest2d_js PRIVATE
1213 ${CMAKE_CURRENT_SOURCE_DIR} /../src
1314)
1415
15- # Link dependencies if needed
16- # target_link_libraries (libnest2d_js <dependencies> )
16+ # Define backend macro for Emscripten
17+ target_compile_definitions (libnest2d_js PRIVATE LIBNEST2D_GEOMETRIES_clipper )
1718
19+ # Emscripten-specific options (optional, but recommended)
20+ target_link_options (libnest2d_js
21+ PUBLIC
22+ "SHELL:-lembind"
23+ "SHELL:-sEXPORTED_RUNTIME_METHODS=[FS]"
24+ "SHELL:-sENVIRONMENT=web"
25+ "SHELL:-sMODULARIZE=1"
26+ "SHELL:-sEXPORT_ES6=1"
27+ "SHELL:-sWASMFS=1"
28+ "SHELL:-sALLOW_MEMORY_GROWTH=1"
29+ "SHELL:-sERROR_ON_UNDEFINED_SYMBOLS=0"
30+ )
31+
32+ # If you want to enable debug options, add them conditionally:
33+ # $<$<CONFIG:Debug>:SHELL:-g3>
34+ # $<$<CONFIG:Debug>:SHELL:-gsource-map>
You can’t perform that action at this time.
0 commit comments