Skip to content

Commit cfd4d91

Browse files
committed
Use version of python generated by script
1 parent c17dce5 commit cfd4d91

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/pybindings/pycontroller/BUILD.gn

+4-3
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ shared_library("CHIPController") {
4343
output_dir = "${target_out_dir}/pychip"
4444

4545
# TODO: Update to use GN tools to get actual paths
46+
python_version = exec_script("python-version.py", [], "trim string")
4647
include_dirs = [ "${chip_root}/third_party/pybind11/repo/include" ]
4748
if (current_os == "mac") {
4849
include_dirs +=
49-
[ "${chip_root}/.environment/cipd/packages/python/include/python3.9" ]
50+
[ "${chip_root}/.environment/cipd/packages/python/include/python" + python_version ]
5051
} else if (current_os == "linux") {
51-
include_dirs += [ "/usr/include/python3.9" ]
52+
include_dirs += [ "/usr/include/python" + python_version ]
5253
} else {
5354
assert(false, "OS not supported.")
5455
}
@@ -86,7 +87,7 @@ shared_library("CHIPController") {
8687
]
8788
}
8889
if (current_os == "linux") {
89-
libs = [ "python3.9" ]
90+
libs = [ "python" + python_version ]
9091
}
9192
}
9293

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env python3
2+
3+
import sys
4+
print(f"{sys.version_info.major}.{sys.version_info.minor}")

0 commit comments

Comments
 (0)