Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 46d2ddf

Browse filesBrowse files
committed
Temporary hack to fix build regression with Scikit-build 0.17.3 and newer.
1 parent 0ba2c80 commit 46d2ddf
Copy full SHA for 46d2ddf

File tree

Expand file treeCollapse file tree

1 file changed

+8
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-3
lines changed

‎setup.py

Copy file name to clipboardExpand all lines: setup.py
+8-3Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,14 @@ def main():
3636
]
3737

3838
python_version = cmaker.CMaker.get_python_version()
39-
python_lib_path = (cmaker.CMaker.get_python_library(python_version) or "").replace(
40-
"\\", "/"
41-
)
39+
python_lib_path = cmaker.CMaker.get_python_library(python_version) or ""
40+
# HACK: For Scikit-build 0.17.3 and newer that returns None or empty sptring for PYTHON_LIBRARY in manylinux2014
41+
# A small release related to PYTHON_LIBRARY handling changes in 0.17.2; scikit-build 0.17.3 returns an empty string from get_python_library if no Python library is present (like on manylinux), where 0.17.2 returned None, and previous versions returned a non-existent path. Note that adding REQUIRED to find_package(PythonLibs will fail, but it is incorrect (you must not link to libPython.so) and was really just injecting a non-existent path before.
42+
# TODO: Remove the hack when the issue is handled correctly in main OpenCV CMake.
43+
if python_lib_path == "":
44+
python_lib_path = "libpython%sm.a" % python_version
45+
python_lib_path = python_lib_path.replace("\\", "/")
46+
4247
python_include_dir = cmaker.CMaker.get_python_include_dir(python_version).replace(
4348
"\\", "/"
4449
)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.