Skip to content

Commit 9d3daba

Browse files
danielhersneubig
authored andcommitted
Fix #801: pass BACKEND to cmake if given as env var to setup.py (#808)
* Fix #801: pass BACKEND to cmake if given as env var to setup.py * Fix error when running setup.py without arguments * Include README and LICENSE in MANIFEST Former-commit-id: 72d6fab
1 parent 2c1477a commit 9d3daba

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

MANIFEST.in

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
graft python
22
global-include *.py *.cc *.h *.cu CMakeLists.txt *.cmake
3+
include README.md
4+
include LICENSE.txt

setup.py

+5
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def get_env(build_dir):
5959
pass
6060

6161
# Get values passed on the command line
62+
i = 0
6263
for i, arg in enumerate(sys.argv[1:]):
6364
try:
6465
key, value = arg.split("=", 1)
@@ -228,6 +229,10 @@ def run(self):
228229
"-DEIGEN3_INCLUDE_DIR=" + EIGEN3_INCLUDE_DIR,
229230
"-DPYTHON=" + PYTHON,
230231
]
232+
for env_var in ("BACKEND",):
233+
value = ENV.get(env_var)
234+
if value is not None:
235+
cmake_cmd.append("-D" + env_var + "=" + value)
231236
log.info("Configuring...")
232237
if run_process(cmake_cmd) != 0:
233238
raise DistutilsSetupError(" ".join(cmake_cmd))

0 commit comments

Comments
 (0)