Skip to content

Commit

Permalink
fix editable build
Browse files Browse the repository at this point in the history
  • Loading branch information
magland committed Jan 24, 2025
1 parent 4a50e4c commit 37e064e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,9 @@ install(TARGETS _simple_ans
install(FILES ${HEADERS}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/simple_ans
)

# For editable installs, copy the extension module to the source directory
add_custom_command(TARGET _simple_ans POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:_simple_ans> ${CMAKE_SOURCE_DIR}/simple_ans/
COMMENT "Copying extension module to source directory for editable install"
)
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ cmake.verbose = true
sdist.include = ["simple_ans/cpp/*"]
wheel.packages = ["simple_ans"]
build-dir = "build"
editable.mode = "redirect"

[tool.setuptools]
packages = ["simple_ans"]
Expand Down

0 comments on commit 37e064e

Please sign in to comment.