From 87e709aa1c070f55e45807ea70a53afd5eadcf5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= Date: Sat, 9 Dec 2023 15:01:33 +0100 Subject: [PATCH] cmake: declare the pycsdiff target as a MODULE library ... to mark the intent that it is meant to be used by `dlopen` only. Consequently, this forces the library to always use the `.so` suffix which fixes the following test failure on macOS because Python ignores shared libraries with the native `.dylib` suffix. ``` pycsdiff_py3......................................***Failed 0.02 sec Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'pycsdiff' ``` --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b8b5a86e..59cfac49 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -105,7 +105,7 @@ macro(build_pycsdiff version) message(STATUS "Python ${version} binding enabled. " "The pycsdiff module will be built!") - add_library(pycsdiff_py${version} SHARED pycsdiff.cc) + add_library(pycsdiff_py${version} MODULE pycsdiff.cc) target_link_libraries(pycsdiff_py${version} PRIVATE ${Boost_PYTHON${PYTHON_VERSION_SUFFIX}_LIBRARY} Python${version}::Module)