You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generates sirius _nanobind and I can use it in python no problem (only issue is that I get .so.so as an extension so that is why I rename it, it won't work if I do not. Would like a fix for this as well)
nanobind_add_stub just does not seem to do anything. No files are generated in any folder in the entire project. No errors are thrown, and if I use VERBOSE I do not get any additional messages. I can't provide a reproducible example because it will take some obfuscation, but can if no one has any ideas. Thanks.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have the following cmake fie:
execute_process(
COMMAND python3 -c "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'), end='')"
OUTPUT_VARIABLE PYTHON_MODULE_EXTENSION
)
file(GLOB_RECURSE BINDING_SOURCES
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
)
nanobind_add_module(sirius_nanobind ${BINDING_SOURCES})
target_link_libraries(sirius_nanobind PRIVATE sirius_cpp)
set_target_properties(sirius_nanobind PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
PREFIX ""
)
nanobind_add_stub(
sirius_nanobind_stub
MODULE sirius_nanobind
OUTPUT sirius_nanobind.pyi
PYTHON_PATH $<TARGET_FILE_DIR:sirius_nanobind>
DEPENDS sirius_nanobind
)
add_custom_command(TARGET sirius_nanobind POST_BUILD
COMMAND ${CMAKE_COMMAND} -E rename
"${CMAKE_BINARY_DIR}/lib/sirius_nanobind${PYTHON_MODULE_EXTENSION}.so"
"${CMAKE_BINARY_DIR}/lib/sirius_nanobind${PYTHON_MODULE_EXTENSION}"
)
Generates sirius _nanobind and I can use it in python no problem (only issue is that I get .so.so as an extension so that is why I rename it, it won't work if I do not. Would like a fix for this as well)
nanobind_add_stub just does not seem to do anything. No files are generated in any folder in the entire project. No errors are thrown, and if I use VERBOSE I do not get any additional messages. I can't provide a reproducible example because it will take some obfuscation, but can if no one has any ideas. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions