-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bring Nanobind. Fix object leak in
from_numpy
(#2545)
- Loading branch information
1 parent
5f65be0
commit 8ffa1fa
Showing
20 changed files
with
325 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# ============================================================================= | ||
# minimal nanobind interface | ||
# ============================================================================= | ||
|
||
set(NB_DIR ${PROJECT_SOURCE_DIR}/external/nanobind) | ||
|
||
function(make_nanobind_target TARGET_NAME PYINC) | ||
add_library(${TARGET_NAME} STATIC ${NB_DIR}/src/nb_combined.cpp) | ||
target_include_directories(${TARGET_NAME} SYSTEM PUBLIC ${NB_DIR}/include) | ||
target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${NB_DIR}/ext/robin_map/include ${PYINC}) | ||
if(MSVC) | ||
# Do not complain about vsnprintf | ||
target_compile_definitions(${TARGET_NAME} PRIVATE -D_CRT_SECURE_NO_WARNINGS) | ||
else() | ||
# Generally needed to handle type punning in Python code | ||
target_compile_options(${TARGET_NAME} PRIVATE -fno-strict-aliasing) | ||
endif() | ||
target_compile_features(${TARGET_NAME} PUBLIC cxx_std_17) | ||
set_property(TARGET ${TARGET_NAME} PROPERTY POSITION_INDEPENDENT_CODE True) | ||
set_property(TARGET ${TARGET_NAME} PROPERTY INTERPROCEDURAL_OPTIMIZATION_RELEASE ON) | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.