bump version to 2022.02.9

add miyoo_defconfig
This commit is contained in:
tiopex
2023-01-31 13:11:45 +01:00
parent 1fa746c353
commit dcdaa3599c
8423 changed files with 184304 additions and 91106 deletions
@@ -0,0 +1,6 @@
config BR2_PACKAGE_PYTHON_PYBIND_EXAMPLE
bool "python-pybind-example"
depends on BR2_PACKAGE_PYTHON3
select BR2_PACKAGE_PYTHON_PYBIND
help
This test creates a cpp macro later used on target in python
@@ -0,0 +1,16 @@
#include <pybind11/pybind11.h>
namespace py = pybind11;
int add (int i, int j) {
return i + j;
}
PYBIND11_MODULE (example, m) {
// optional module description
m.doc() = "pybind11 example plugin";
// test a module method
m.def("add", &add, "example::add adds two integer numbers");
// test a module attribute
py::object hello = py::cast("Hello World");
m.attr("says") = hello;
}
@@ -0,0 +1,41 @@
################################################################################
#
# python-pybind-example
#
################################################################################
# this builds a C++ macro "add(a,b)"
# that we expose to host-python with a custom install
# and that the python test script will later use
PYTHON_PYBIND_EXAMPLE_DEPENDENCIES = python-pybind
PYTHON_PYBIND_EXAMPLE_PYBIND_INCLUDE = \
$(shell $(HOST_DIR)/usr/bin/python3 -c 'import pybind11; print(pybind11.get_include())')
PYTHON_PYBIND_EXAMPLE_CXX_FLAGS = \
$(TARGET_CXXFLAGS) \
-Wall -shared -std=c++11 -fPIC \
-I$(PYTHON_PYBIND_EXAMPLE_PYBIND_INCLUDE) \
$(shell $(STAGING_DIR)/usr/bin/python3-config --includes --libs --ldflags)
# .so to be installed must have exact suffix
# otherwise import() in python will not work
HOST_LIB_BINARY_SUFFIX = \
$(shell $(STAGING_DIR)/usr/bin/python3-config --extension-suffix)
define PYTHON_PYBIND_EXAMPLE_BUILD_CMDS
if [ -z "$(PYTHON_PYBIND_EXAMPLE_PYBIND_INCLUDE)" ]; then \
echo "pybind11.get_include() returned empty"; \
exit 1; \
fi
$(TARGET_CXX) $(PYTHON_PYBIND_EXAMPLE_CXX_FLAGS) \
$(PYTHON_PYBIND_EXAMPLE_PKGDIR)/example.cpp \
-o $(@D)/example$(HOST_LIB_BINARY_SUFFIX)
endef
define PYTHON_PYBIND_EXAMPLE_INSTALL_TARGET_CMDS
$(INSTALL) -D -m 755 $(@D)/example$(HOST_LIB_BINARY_SUFFIX) \
$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/example$(HOST_LIB_BINARY_SUFFIX)
endef
$(eval $(generic-package))