Skip to content

Commit

Permalink
Merge pull request PyO3#38 from pganssle/rustc_flags
Browse files Browse the repository at this point in the history
Add rustc_flags
  • Loading branch information
konstin authored Aug 8, 2018
2 parents 5c94981 + 9da3509 commit f15e8fb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ You can define rust extension with `RustExtension` class:

:param [str] features: a list of features to also build

:param [str] rustc_flags: A list of arguments to pass to `rustc`, e.g.
`cargo rustc --features <features> <args> -- <rustc_flags>`

:param str rust_version: sematic version of rust compiler version -- for example
*>1.14,<1.16*, default is None

Expand Down
1 change: 1 addition & 0 deletions setuptools_rust/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def build_extension(self, ext):
args.append("-q")

args.extend(["--", "--crate-type", "cdylib"])
args.extend(ext.rustc_flags or [])

# OSX requires special linker argument
if sys.platform == "darwin":
Expand Down
2 changes: 2 additions & 0 deletions setuptools_rust/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def __init__(
path,
args=None,
features=None,
rustc_flags=None,
rust_version=None,
quiet=False,
debug=None,
Expand All @@ -73,6 +74,7 @@ def __init__(
self.name = name
self.target = target
self.args = args
self.rustc_flags = rustc_flags
self.binding = binding
self.rust_version = rust_version
self.quiet = quiet
Expand Down

0 comments on commit f15e8fb

Please sign in to comment.