diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ed3bc2..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 SHARED ${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()