Skip to content
Snippets Groups Projects
Commit 3cc45764 authored by Joe Snyder's avatar Joe Snyder
Browse files

Merge branch 'master' into 'dev/add-component-filters'

# Conflicts:
#   autopybind11/__main__.py
parents 53a9dd95 523b6997
No related branches found
No related tags found
No related merge requests found
......@@ -775,6 +775,37 @@ For more details, see this GitHub discussion:
`drake#7889 (comment)
<https://github.com/RobotLocomotion/drake/issues/7889#issuecomment-663721506>`_.
FFIG
####
* https://github.com/FFIG/ffig
Intended to be a more modern replacement for SWIG, leveraging a vendored fork
of ``clang.cindex`` Python bindings to libclang. At time of writing, provides
binding generation on C/C++, with
`Jinja2 <https://jinja.palletsprojects.com/en/2.11.x/>`_ as a template engine,
to generate bindings for:
- Python (Boost.Python, ctypes)
- .NET
- Go
- Java
- Swift
and preliminary / incomplete bindings for:
- D
- Lua
- Ruby
- Rust
.. note::
Preliminary bindings determined by (naively) comparing the directory listings
of
`ffig/templates <https://github.com/FFIG/ffig/tree/b45060d5835292a74661678872427e3eb5a89d0c/ffig/templates>`_ vs.
`ffig/generators <yhttps://github.com/FFIG/ffig/tree/b45060d5835292a74661678872427e3eb5a89d0c/ffig/generators>`_.
Other Mentions
##############
......
......@@ -45,4 +45,5 @@ add_autopybind11_test(custom_namespaces)
add_autopybind11_test(extra_includes)
add_autopybind11_failing_test(extra_includes/expect_failure)
add_autopybind11_test(file_collisions)
add_autopybind11_test(virtuality)
add_subdirectory(code_generation_regression)
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt
cmake_minimum_required(VERSION 3.15)
project(virtuality CXX)
find_package(AutoPyBind11)
autopybind11_fetch_build_pybind11(PYBIND11_DIR ${PYBIND11_SRC_DIR})
add_library(virtuality INTERFACE)
target_sources(virtuality INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/base.hpp
${CMAKE_CURRENT_SOURCE_DIR}/derived.hpp
)
target_include_directories(virtuality INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
autopybind11_add_module("virtuality_module"
YAML_INPUT ${CMAKE_CURRENT_SOURCE_DIR}/wrapper_input.yml
CONFIG_INPUT ${CMAKE_CURRENT_SOURCE_DIR}/config.yml
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
LINK_LIBRARIES virtuality
)
#ifndef BASE_H
#define BASE_H
#include <string>
class Base
{
public:
virtual inline int get_var() = 0;
virtual inline std::string hello() = 0;
protected:
int var_base;
};
#endif // BASE_H
\ No newline at end of file
private_members_as_fields: False
\ No newline at end of file
#ifndef DERIVED_H
#define DERIVED_H
#include "base.hpp"
class Derived : public Base
{
public:
Derived(int d) {var_base = d;}
Derived( Derived const& d) {this->var_base = d.var_base;}
virtual inline int get_var() {return var_base;}
virtual inline std::string hello() { return "Hello World";}
inline int get_answer() {return 42;}
protected:
};
#endif // DERIVED_H
\ No newline at end of file
import sys
import os
files:
base.hpp:
classes:
Base:
derived.hpp:
classes:
Derived:
......@@ -998,6 +998,9 @@ class BindingsGenerator:
# Also need to add to pyclass_args
pyclass_args += ", " + tramp_name
else:
tramp_methods = []
# Now we'll deal with any protected functions, as we want these to be visible
# to python subclasses. Especially if they are virtual and appear in the
# trampoline for overriding.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment