Skip to content

Commit

Permalink
cmake: declare the pycsdiff target as a MODULE library
Browse files Browse the repository at this point in the history
... 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 "<string>", line 1, in <module>
      ModuleNotFoundError: No module named 'pycsdiff'
```
  • Loading branch information
lzaoral committed Dec 10, 2023
1 parent 9f94669 commit 87e709a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 87e709a

Please sign in to comment.