From 79f8d50657d72162cda6d192edddc673fd926de7 Mon Sep 17 00:00:00 2001 From: David Hewitt <1939362+davidhewitt@users.noreply.github.com> Date: Fri, 11 Aug 2023 12:48:34 +0100 Subject: [PATCH] set macos link args to fix bin + lib combination --- examples/hello-world-pyprojecttoml/Cargo.lock | 1 + examples/hello-world-pyprojecttoml/Cargo.toml | 3 +++ examples/hello-world-pyprojecttoml/MANIFEST.in | 2 +- examples/hello-world-pyprojecttoml/build.rs | 3 +++ 4 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 examples/hello-world-pyprojecttoml/build.rs diff --git a/examples/hello-world-pyprojecttoml/Cargo.lock b/examples/hello-world-pyprojecttoml/Cargo.lock index d18dc500..df786659 100644 --- a/examples/hello-world-pyprojecttoml/Cargo.lock +++ b/examples/hello-world-pyprojecttoml/Cargo.lock @@ -25,6 +25,7 @@ name = "hello-world" version = "0.1.0" dependencies = [ "pyo3", + "pyo3-build-config", ] [[package]] diff --git a/examples/hello-world-pyprojecttoml/Cargo.toml b/examples/hello-world-pyprojecttoml/Cargo.toml index 10d1242f..eda9301c 100644 --- a/examples/hello-world-pyprojecttoml/Cargo.toml +++ b/examples/hello-world-pyprojecttoml/Cargo.toml @@ -21,3 +21,6 @@ path = "rust/lib.rs" [[bin]] name = "print-hello" path = "rust/print_hello.rs" + +[build-dependencies] +pyo3-build-config = "0.19.2" diff --git a/examples/hello-world-pyprojecttoml/MANIFEST.in b/examples/hello-world-pyprojecttoml/MANIFEST.in index 84f0cfbb..c79be56f 100644 --- a/examples/hello-world-pyprojecttoml/MANIFEST.in +++ b/examples/hello-world-pyprojecttoml/MANIFEST.in @@ -1,6 +1,6 @@ graft python graft rust graft tests -include Cargo.toml noxfile.py +include Cargo.toml noxfile.py build.rs global-exclude */__pycache__/* global-exclude *.pyc diff --git a/examples/hello-world-pyprojecttoml/build.rs b/examples/hello-world-pyprojecttoml/build.rs new file mode 100644 index 00000000..dace4a9b --- /dev/null +++ b/examples/hello-world-pyprojecttoml/build.rs @@ -0,0 +1,3 @@ +fn main() { + pyo3_build_config::add_extension_module_link_args(); +}