Skip to content

Commit

Permalink
Use NB_STATIC on windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
joaander committed Jun 24, 2024
1 parent a5e0e9a commit c17401a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ if(nanobind_FOUND)
"[${nanobind_DIR},${nanobind_VERSION}]")
endif()

# shared nanobind linking seems broken on windows for unknown reasons
if(WIN32)
set(freud_nanobind_linking "NB_STATIC")
else()
set(freud_nanobind_linking "NB_SHARED")
endif()

# Fail fast if users have not cloned submodules.
if(NOT WIN32)
string(ASCII 27 Esc)
Expand Down
2 changes: 1 addition & 1 deletion cpp/box/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# create the target and add the needed properties
nanobind_add_module(_box NB_SHARED module-box.cc export_Box.cc)
nanobind_add_module(_box ${freud_nanobind_linking} module-box.cc export_Box.cc)
target_link_libraries(_box PUBLIC libfreud)

if(APPLE)
Expand Down
2 changes: 1 addition & 1 deletion cpp/parallel/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
nanobind_add_module(_parallel NB_SHARED module-parallel.cc)
nanobind_add_module(_parallel ${freud_nanobind_linking} module-parallel.cc)
target_link_libraries(_parallel PUBLIC libfreud)

if(APPLE)
Expand Down

0 comments on commit c17401a

Please sign in to comment.