From f07a9a3dffa0f5dc389462c4f782dbba785aac3a Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Wed, 22 Oct 2025 19:47:39 +0500 Subject: [PATCH] ifcwrap cmake - accomodate bug in cmake makefiles generator --- src/ifcwrap/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ifcwrap/CMakeLists.txt b/src/ifcwrap/CMakeLists.txt index 156c731c67..b216146502 100644 --- a/src/ifcwrap/CMakeLists.txt +++ b/src/ifcwrap/CMakeLists.txt @@ -97,6 +97,15 @@ if (WASM_BUILD) # Possibly in the future we can clean up linked libs and try `=1`. # SIDE_MODULE=2 - add to .so only explicitly exported functions (`-s EXPORTED_FUNCTIONS). # Have to provide it here to override possible `=1` coming from pyodide. + if(CMAKE_GENERATOR MATCHES "Makefile") + # Accomodate bug in cmake makefile generator: + # https://gitlab.kitware.com/cmake/cmake/-/issues/27326 + string( + REPLACE "SIDE_MODULE=1" "SIDE_MODULE=2" + CMAKE_MODULE_LINKER_FLAGS + "${CMAKE_MODULE_LINKER_FLAGS}" + ) + endif() target_link_options( ${SWIG_MODULE_ifcopenshell_wrapper_REAL_NAME} PRIVATE "SHELL:-s EXPORTED_FUNCTIONS=_PyInit__ifcopenshell_wrapper -s SIDE_MODULE=2"