Skip to content

Commit d66f7a5

Browse files
committed
support CARGO_TARGET_DIR variable #14
1 parent 8b0fcaa commit d66f7a5

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

CHANGES.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
CHANGES
22
=======
33

4+
0.6.1 (2017-06-30)
5+
------------------
6+
7+
- Support `CARGO_TARGET_DIR` variable #14
8+
9+
410
0.6.0 (2017-06-20)
511
------------------
612

setuptools_rust/build.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,13 @@ def build_extension(self, ext):
121121
else:
122122
suffix = "release"
123123

124-
target_dir = os.path.join(os.path.dirname(ext.path), "target/", suffix)
124+
# location of files
125+
dir = os.environ.get('CARGO_TARGET_DIR', '').strip()
126+
if dir:
127+
target_dir = os.path.join(dir, suffix)
128+
else:
129+
target_dir = os.path.join(
130+
os.path.dirname(ext.path), "target/", suffix)
125131

126132
if sys.platform == "win32":
127133
wildcard_so = "*.dll"

0 commit comments

Comments
 (0)