scikit-build-core icon indicating copy to clipboard operation
scikit-build-core copied to clipboard

Windows: DLL copied to the wrong directory

Open Tillsten opened this issue 5 months ago • 3 comments

Hi,

i am trying the get a nanobind binding to the Blend2D libarary running. However, the scikit-build does not place the dll correctly. Instead of the libary directory next to the pyd it gets placed into site-packages/bin for some reasone. Any hint?

cmake_minimum_required(VERSION 3.15)

project(${SKBUILD_PROJECT_NAME}
        VERSION ${SKBUILD_PROJECT_VERSION}
        LANGUAGES C CXX)

find_package(Python 3.8
  REQUIRED COMPONENTS Interpreter Development.Module
  OPTIONAL_COMPONENTS Development.SABIModule)

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/blend2d)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/nanobind)

find_package(nanobind CONFIG REQUIRED)

nanobind_add_module(
  # Name of the extension
  blend2dpy_ext

  # Target the stable ABI for Python 3.12+, which reduces
  # the number of binary wheels that must be built. This
  # does nothing on older Python versions
  STABLE_ABI

  # Build libnanobind statically and merge it into the
  # extension (which itself remains a shared library)
  #
  # If your project builds multiple extensions, you can
  # replace this flag by NB_SHARED to conserve space by
  # reusing a shared libnanobind across libraries
  NB_STATIC


  # Source code goes here
  src/blend2dpy_ext.cpp
)

target_include_directories(blend2dpy_ext PRIVATE "${BLEND2D_DIR}/src")
target_link_libraries(blend2dpy_ext PRIVATE blend2d::blend2d)

install(TARGETS blend2dpy_ext DESTINATION ${SKBUILD_PROJECT_NAME})

Tillsten avatar Aug 31 '24 15:08 Tillsten