Skip to content

Commit

Permalink
Auto-configure python path for cmake (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
eanorige authored Feb 15, 2024
1 parent 451b1c8 commit ad3fcbe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pysv/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import shutil
import platform
import filecmp
import sys


def compile_lib(func_defs, cwd, lib_name="pysv", pretty_print=True, release_build=False, clean_up_build=False,
Expand Down Expand Up @@ -61,6 +62,8 @@ def compile_lib(func_defs, cwd, lib_name="pysv", pretty_print=True, release_buil
cmake_args.append("-DCMAKE_BUILD_TYPE=" + build_type)
# add header definition
cmake_args.append("-DDPI_HEADER_DIR=" + vlstd_path)
# tell cmake where to find python (in case it's not in the system path)
cmake_args.append("-DPYTHON_EXECUTABLE=" + sys.executable)
subprocess.check_call(["cmake"] + cmake_args + [".."],
cwd=build_dir)
# built it!
Expand Down

0 comments on commit ad3fcbe

Please sign in to comment.