File tree 2 files changed +20
-5
lines changed
2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,24 @@ and partially just stumbling around procedural macros and syn.
14
14
15
15
Using procedural macros, so of course this needs nightly for now.
16
16
17
+ ## Showcase
18
+
19
+ Write Rust, get python/ruby/java/pick your poison. Try out the [ example] ( #example ) :
20
+
21
+ ``` bash
22
+ cd swig-derive-test
23
+ make
24
+ python -c " import swig_derive_test as sdt; t = sdt.Test(42); print(t.get_field())"
25
+ ```
26
+ ^^^ ` Test ` is a Rust object, behaving like a native Python class.
27
+
28
+
29
+ ## Requirements
30
+
31
+ Needs [ ` cargo-expand ` ] ( https://github.com/dtolnay/cargo-expand/ ) and [ ` swig ` ] ( http://swig.org/ ) installed.
32
+
33
+ ## Organisation
34
+
17
35
[ swiggen] ( swiggen/ ) contains the main parsing/generation code, and also a binary
18
36
for generating the final binders.
19
37
@@ -23,9 +41,6 @@ calls out to swiggen.
23
41
[ swiggen-derive-test] ( swiggen-derive-test/ ) contains an example of the
24
42
functionality.
25
43
26
- ## Requirements
27
-
28
- Needs ` cargo-expand ` and ` swig ` installed.
29
44
30
45
## Example
31
46
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ PKG_NAME=swig_derive_test
2
2
3
3
default : bindings compile
4
4
bindings :
5
- cargo build
6
- cargo run --manifest-path=../swiggen/Cargo.toml
5
+ cargo +nightly build
6
+ cargo +nightly run --manifest-path=../swiggen/Cargo.toml
7
7
8
8
compile :
9
9
swig -python -Wextra -c++ -o swig_wrap.cpp swig.i
You can’t perform that action at this time.
0 commit comments