From 7fa3936946be0909b249f49b8bf4c74fe5316521 Mon Sep 17 00:00:00 2001 From: Connor Ward Date: Thu, 27 Aug 2026 18:23:15 +0100 Subject: [PATCH 1/2] Build a static lib instead of a shared one --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ed3bc2..b40cfb8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -216,7 +216,7 @@ endif() file(GLOB source_files ${LIBSUPERMESH_SOURCE_DIR}/src/*.F90 ${LIBSUPERMESH_SOURCE_DIR}/src/*.c ${LIBSUPERMESH_SOURCE_DIR}/src/*.cpp) if("${SKBUILD}" STREQUAL 2) file(GLOB python_source_files ${LIBSUPERMESH_SOURCE_DIR}/src/supermesh/*.py) - add_library(supermesh SHARED ${source_files} ${python_source_files}) + add_library(supermesh STATIC ${source_files} ${python_source_files}) else() add_library(supermesh ${source_files}) endif() From c73d3cf69689b611db95d9bc1044531001576ce9 Mon Sep 17 00:00:00 2001 From: Connor Ward Date: Fri, 28 Aug 2026 09:49:14 +0100 Subject: [PATCH 2/2] fixup --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b40cfb8..f72f9e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -216,7 +216,13 @@ endif() file(GLOB source_files ${LIBSUPERMESH_SOURCE_DIR}/src/*.F90 ${LIBSUPERMESH_SOURCE_DIR}/src/*.c ${LIBSUPERMESH_SOURCE_DIR}/src/*.cpp) if("${SKBUILD}" STREQUAL 2) file(GLOB python_source_files ${LIBSUPERMESH_SOURCE_DIR}/src/supermesh/*.py) - add_library(supermesh STATIC ${source_files} ${python_source_files}) + # On macOS, the latest clang linker has a bug where some symbols do not + # appear in the dylib. Building a static library resolves this. + if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + add_library(supermesh STATIC ${source_files} ${python_source_files}) + else() + add_library(supermesh SHARED ${source_files} ${python_source_files}) + endif() else() add_library(supermesh ${source_files}) endif()