File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1436,7 +1436,7 @@ def get_cmake_args_prefix_path(additional_paths: "Sequence[str]" = ()) -> "list[
14361436 ADDITIONAL_ARGS = "-Wl,-flat_namespace,-undefined,suppress"
14371437
14381438 if "wasm" in flags :
1439- ADDITIONAL_ARGS = "-Wl,-undefined,suppress -sSIDE_MODULE=2 "
1439+ ADDITIONAL_ARGS = "-Wl,-undefined,suppress"
14401440 # Override CMAKE_TOOLCHAIN_FILE because by default emscripten doesn't support building shared binaries.
14411441 if WASM_DEBUG :
14421442 os .environ ["CMAKE_TOOLCHAIN_FILE" ] = os .environ ["WASM_TOOLCHAIN_FILE" ]
Original file line number Diff line number Diff line change @@ -92,7 +92,15 @@ set(SWIG_MODULE_ifcopenshell_wrapper_EXTRA_FLAGS "-interface" "_ifcopenshell_wra
9292swig_add_library (ifcopenshell_wrapper LANGUAGE python SOURCES IfcPython.i )
9393SET_PROPERTY (TARGET ${SWIG_MODULE_ifcopenshell_wrapper_REAL_NAME} PROPERTY SWIG_DEPENDS ${IFCOPENSHELL_LIBRARIES} )
9494if (WASM_BUILD)
95- target_link_options (${SWIG_MODULE_ifcopenshell_wrapper_REAL_NAME} PRIVATE "-sEXPORTED_FUNCTIONS=_PyInit__ifcopenshell_wrapper" )
95+ # SIDE_MODULE=1 - add to .so all symbols from linked archives (default used by pyodide).
96+ # Since currently libIfcGeom.a seems to be linked twice it results in duplicated symbols and compilation errors.
97+ # Possibly in the future we can clean up linked libs and try `=1`.
98+ # SIDE_MODULE=2 - add to .so only explicitly exported functions (`-s EXPORTED_FUNCTIONS).
99+ # Have to provide it here to override possible `=1` coming from pyodide.
100+ target_link_options (
101+ ${SWIG_MODULE_ifcopenshell_wrapper_REAL_NAME}
102+ PRIVATE "SHELL:-s EXPORTED_FUNCTIONS=_PyInit__ifcopenshell_wrapper -s SIDE_MODULE=2"
103+ )
96104endif ()
97105if ("$ENV{LDFLAGS} " MATCHES ".undefined.suppress" )
98106# On osx there is some state in the python dylib. With `-Wl,undefined,suppress` we can ignore the missing symbols at compile time.
You can’t perform that action at this time.
0 commit comments