Skip to content

Commit

Permalink
Fix python3 executable detection in CMake (#978)
Browse files Browse the repository at this point in the history
Co-authored-by: Enrique G. Paredes <enriqueg@cscs.ch>
  • Loading branch information
jdahm and egparedes authored May 26, 2020
1 parent 2844b49 commit c034c68
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions dawn/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@
# Copy additional C++ headers for the generated code

for srcdir in ["driver-includes", "interface"]:
target_path = os.path.join(DAWN4PY_DIR, "_external_src", srcdir)
if os.path.exists(target_path):
shutil.rmtree(target_path)
shutil.copytree(
os.path.join(DAWN_DIR, "src", srcdir), target_path,
)
target_path = os.path.join(DAWN4PY_DIR, "_external_src", srcdir)
if os.path.exists(target_path):
shutil.rmtree(target_path)
shutil.copytree(
os.path.join(DAWN_DIR, "src", srcdir), target_path,
)

# Based on:
# https://www.benjack.io/2018/02/02/python-cpp-revisited.html
Expand Down Expand Up @@ -130,9 +130,10 @@ def compile_extension(self, build_dir, cmake="cmake"):
# Run CMake configure
print("-" * 10, "Running CMake prepare", "-" * 40)
cmake_args += [
"-DPYTHON_EXECUTABLE=" + sys.executable,
"-DBUILD_TESTING=OFF",
"-DDAWN_REQUIRE_PYTHON=ON",
f"-DPYTHON_EXECUTABLE={sys.executable}",
f"-DPython3_EXECUTABLE={sys.executable}",
]
if not self.inplace:
cmake_args.append("-DDAWN4PY_MODULE_DIR=" + self.build_lib)
Expand Down

0 comments on commit c034c68

Please sign in to comment.