Skip to content

Commit c94ccfe

Browse files
committed
Fix?
1 parent eb31c4a commit c94ccfe

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,14 @@ if(BUILD_PYTHON_BINDINGS)
195195
endif()
196196

197197
# Add the Python binding module
198-
add_library(dsf_python_module MODULE src/dsf/bindings.cpp)
198+
pybind11_add_module(dsf_python_module src/dsf/bindings.cpp)
199199

200200
# Ensure the Python module name has no 'lib' prefix on Unix systems
201-
set_target_properties(dsf_python_module PROPERTIES PREFIX "" OUTPUT_NAME
202-
"dsf_cpp")
201+
set_target_properties(dsf_python_module PROPERTIES OUTPUT_NAME "dsf_cpp")
203202

204203
# Link the pybind11 module with your static library and pybind11
205204
target_link_libraries(
206-
dsf_python_module PRIVATE dsf pybind11::module pybind11::headers TBB::tbb
205+
dsf_python_module PRIVATE dsf pybind11::headers TBB::tbb
207206
spdlog::spdlog)
208207
target_compile_definitions(dsf_python_module PRIVATE SPDLOG_USE_STD_FORMAT)
209208

setup.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ def build_extension(self, ext: CMakeExtension):
7878
"-DBUILD_PYTHON_BINDINGS=ON",
7979
]
8080

81+
if platform.system() == "Windows":
82+
cmake_args += [
83+
f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{cfg.upper()}={extdir}"
84+
]
85+
8186
# Add macOS-specific CMake prefix paths for Homebrew dependencies
8287
if platform.system() == "Darwin": # macOS
8388
try:

0 commit comments

Comments
 (0)