forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pybind11] update to v2.10.4 (microsoft#32194)
* [pybind11] update to v2.10.4, clean-up redundant dependency, add usage
- Loading branch information
Showing
11 changed files
with
77 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
pybind11 provides CMake targets. There are two modes provided; classic, which is built on the old Python | ||
discovery packages in CMake, or the new FindPython mode, which uses FindPython | ||
from 3.12+ forward (3.15+ _highly_ recommended). | ||
|
||
New FindPython mode: | ||
|
||
find_package(Python COMPONENTS Interpreter Development) | ||
find_package(pybind11 CONFIG) | ||
|
||
# pybind11 method: | ||
pybind11_add_module(MyModule1 src1.cpp) | ||
|
||
# Python method: | ||
Python_add_library(MyModule2 src2.cpp) | ||
target_link_libraries(MyModule2 pybind11::headers) | ||
set_target_properties(MyModule2 PROPERTIES | ||
INTERPROCEDURAL_OPTIMIZATION ON | ||
CXX_VISIBILITY_PRESET ON | ||
VISIBILITY_INLINES_HIDDEN ON | ||
) | ||
|
||
For more information see here: | ||
https://pybind11.readthedocs.io/en/latest/compiling.html#building-with-cmake |
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,25 @@ | ||
diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt | ||
index eef14ee..30130ba 100644 | ||
--- a/modules/python/CMakeLists.txt | ||
+++ b/modules/python/CMakeLists.txt | ||
@@ -1,10 +1,10 @@ | ||
include(CMakeSources.cmake) | ||
set(MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
+find_package(Python COMPONENTS Interpreter Development) | ||
find_package(pybind11 CONFIG REQUIRED) | ||
|
||
- | ||
-if (WIN32) | ||
+if (FALSE) | ||
## We need pyton dll | ||
file(GLOB PYTHON_DLL ${PYTHON_LIBRARIES}/../*.dll) | ||
|
||
@@ -19,6 +19,6 @@ endif () | ||
|
||
CREATE_MODULE(shiva::pyscripting "${MODULE_SOURCES}" ${MODULE_PATH} "python") | ||
|
||
-target_link_libraries(pyscripting INTERFACE shiva::ecs shiva::input pybind11::embed pybind11::module) | ||
+target_link_libraries(pyscripting INTERFACE shiva::ecs shiva::input pybind11::embed pybind11::module Python::Module) | ||
|
||
AUTO_TARGETS_MODULE_INSTALL(pyscripting) |
This file was deleted.
Oops, something went wrong.
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
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