Skip to content

Commit

Permalink
Merge pull request #852 from asmorkalov:as/ci_check
Browse files Browse the repository at this point in the history
Temporary hack to cover Scikit-build 0.17.3 and newer
  • Loading branch information
asmorkalov authored May 31, 2023
2 parents 0ba2c80 + 46d2ddf commit ccb99df
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,14 @@ def main():
]

python_version = cmaker.CMaker.get_python_version()
python_lib_path = (cmaker.CMaker.get_python_library(python_version) or "").replace(
"\\", "/"
)
python_lib_path = cmaker.CMaker.get_python_library(python_version) or ""
# HACK: For Scikit-build 0.17.3 and newer that returns None or empty sptring for PYTHON_LIBRARY in manylinux2014
# 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.
# TODO: Remove the hack when the issue is handled correctly in main OpenCV CMake.
if python_lib_path == "":
python_lib_path = "libpython%sm.a" % python_version
python_lib_path = python_lib_path.replace("\\", "/")

python_include_dir = cmaker.CMaker.get_python_include_dir(python_version).replace(
"\\", "/"
)
Expand Down

0 comments on commit ccb99df

Please sign in to comment.