build: track xo-cmake streamlining

This commit is contained in:
Roland Conybeare 2023-10-17 15:13:19 -04:00
commit 4246f33642
3 changed files with 5 additions and 4 deletions

View file

@ -42,7 +42,7 @@ add_subdirectory(src/pyreflect)
# ----------------------------------------------------------------
# provide find_package() support
xo_export_cmake_config(${PROJECT_NAME} ${PROJECT_VERSION} pyreflectTargets)
xo_export_cmake_config(${PROJECT_NAME} ${PROJECT_VERSION} ${PROJECT_NAME}Targets)
# ----------------------------------------------------------------
# install .hpp files

View file

@ -1,4 +1,4 @@
# xo_pyreflect/CMakeLists.txt
# xo_pyreflect/src/pyreflect/CMakeLists.txt
set(SELF_LIB pyreflect)
set(SELF_SRCS pyreflect.cpp)
@ -6,7 +6,7 @@ set(SELF_SRCS pyreflect.cpp)
# ----------------------------------------------------------------
# pybind11 dep
xo_pybind11_library(${SELF_LIB} ${SELF_SRCS})
xo_pybind11_library(${SELF_LIB} ${PROJECT_NAME}Targets ${SELF_SRCS})
xo_pybind11_dependency(${SELF_LIB} reflect)

View file

@ -26,7 +26,8 @@ namespace xo {
//py::class_<utc_nanos>(m, "utc_nanos");
//py::class_<TypeDescrImpl>(m, "TypeDescr");
py::class_<TypeDescrBase, unowned_ptr<TypeDescrBase>>(m, "TypeDescr")
py::class_<TypeDescrBase,
unowned_ptr<TypeDescrBase>>(m, "TypeDescr")
.def_static("print_reflected_types",
[](){ TypeDescrBase::print_reflected_types(std::cout); })
.def_property_readonly("canonical_name", &TypeDescrBase::canonical_name)