Skip to content

Commit

Permalink
Migrate to cxxheaderparser
Browse files Browse the repository at this point in the history
  • Loading branch information
virtuald committed Oct 9, 2023
1 parent 906503d commit 5dc4517
Show file tree
Hide file tree
Showing 38 changed files with 2,530 additions and 1,597 deletions.
2 changes: 1 addition & 1 deletion robotpy_build/autowrap/cls_prologue.cpp.j2
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{% endif %}

{% for decl in using_declarations %}
using {{ decl }};
using {{ decl.format() }};
{% endfor %}

{% for cls in classes_with_trampolines %}
Expand Down
6 changes: 0 additions & 6 deletions robotpy_build/autowrap/cls_rpy_include.hpp.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
- Template constructors/method fillers (if applicable)
#}
{# TODO: remove when h2w is removed #}
{% if 'class_ctx' not in cls %}{{ skip_generation() }}{% endif %}
{% set cls = cls.class_ctx %}
{% if not cls.trampoline and not cls.template %}
{{ skip_generation() }}
{% endif %}

// This file is autogenerated. DO NOT EDIT

Expand Down
2 changes: 1 addition & 1 deletion robotpy_build/autowrap/cls_tmpl_impl.hpp.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ using namespace {{ cls.namespace }};
{% endif %}

{% for decl in using_declarations %}
using {{ decl }};
using {{ decl.format() }};
{% endfor %}

template <{{ cls.template.parameter_list }}>
Expand Down
2 changes: 0 additions & 2 deletions robotpy_build/autowrap/cls_tmpl_inst.cpp.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{% include "cls_prologue.cpp.j2" %}

{% set tmpl_data = template_instances[per_tmpl_vars.index] %}

#include <rpygen/{{ tmpl_data.header_name }}>
#include "{{ hname }}_tmpl.hpp"

Expand Down
2 changes: 1 addition & 1 deletion robotpy_build/autowrap/cls_tmpl_inst.hpp.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace rpygen {

{% for tmpl_data in template_instances.values() %}
{% for tmpl_data in template_instances %}
struct {{ tmpl_data.binder_typename }} {
{{ tmpl_data.binder_typename }}(py::module &m, const char * clsName);
void finish(const char *set_doc, const char *add_doc);
Expand Down
5 changes: 4 additions & 1 deletion robotpy_build/autowrap/cls_trampoline.hpp.j2
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ using namespace {{ cls.namespace }};
{% endif %}

{% for decl in using_declarations %}
using {{ decl }};
using {{ decl.format() }};
{% endfor %}

{#
Expand Down Expand Up @@ -122,6 +122,9 @@ struct PyTrampoline_{{ cls.full_cpp_name_identifier }} : PyTrampolineBase, virtu
{% for ccls in cls.child_classes if not ccls.template %}
using {{ ccls.cpp_name }} [[maybe_unused]] = typename {{ ccls.full_cpp_name }};
{% endfor %}
{% for enum in cls.enums if enum.cpp_name %}
using {{ enum.cpp_name }} [[maybe_unused]] = typename {{ enum.full_cpp_name }};
{% endfor %}
{% for typealias in cls.user_typealias %}
{{ typealias }};
{% endfor %}
Expand Down
1 change: 0 additions & 1 deletion robotpy_build/autowrap/clsdeps.json.j2

This file was deleted.

Loading

0 comments on commit 5dc4517

Please sign in to comment.