-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dc12d03
commit 424a3b9
Showing
3 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[target.aarch64-apple-darwin] | ||
|
||
rustflags = [ | ||
"-C", "link-arg=-undefined", | ||
"-C", "link-arg=dynamic_lookup", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
use pyo3_stub_gen::Result; | ||
|
||
fn main() -> Result<()> { | ||
println!("Generating stub info..."); | ||
let stub = bindings::stub_info()?; | ||
println!("Generating stubs..."); | ||
stub.generate()?; | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
use kscaleos::hello_world as kscaleos_hello_world; | ||
use pyo3::prelude::*; | ||
use pyo3::{wrap_pyfunction, PyResult}; | ||
use pyo3_stub_gen::define_stub_info_gatherer; | ||
|
||
#[pyfunction] | ||
pub fn hello_world() { | ||
pub fn hello_world() -> PyResult<()> { | ||
kscaleos_hello_world(); | ||
Ok(()) | ||
} | ||
|
||
#[pymodule] | ||
fn bindings(m: &Bound<PyModule>) -> PyResult<()> { | ||
m.add_wrapped(wrap_pyfunction!(hello_world))?; | ||
Ok(()) | ||
} | ||
|
||
define_stub_info_gatherer!(stub_info); |