diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-04-15 15:27:49 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-04-21 13:19:58 +0200 |
| commit | 4cde4075f97fc9f8d349591291289127666b35e5 (patch) | |
| tree | 98a36dcfac8e46b11dfc27d38fcf33a8a5c41193 /build_scripts/main.py | |
| parent | 3506158551488788450498f9b4ffe86375172fea (diff) | |
Build system: Make numpy centrally available
In order to be able to use numpy in PySide6 modules
besides libshiboken, move the numpy detection into the
build scripts and pass it as a CMake variable.
Task-number: PYSIDE-1540
Task-number: PYSIDE-1503
Change-Id: Ib30fdbab83904878286b7eaae1674ffba0f2febd
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'build_scripts/main.py')
| -rw-r--r-- | build_scripts/main.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/build_scripts/main.py b/build_scripts/main.py index a059ea834..0f887a830 100644 --- a/build_scripts/main.py +++ b/build_scripts/main.py @@ -46,7 +46,7 @@ import sys from textwrap import dedent import time from .config import config -from .utils import get_python_dict +from .utils import get_numpy_location, get_python_dict from .options import DistUtilsCommandMixin, OPTION from .versions import PYSIDE, PYSIDE_MODULE, SHIBOKEN from .wheel_utils import (get_package_version, get_qt_version, @@ -768,6 +768,10 @@ class PysideBuild(_build, DistUtilsCommandMixin): if OPTION['AVOID_PROTECTED_HACK']: cmake_cmd.append("-DAVOID_PROTECTED_HACK=1") + numpy = get_numpy_location() + if numpy: + cmake_cmd.append(f"-DNUMPY_INCLUDE_DIR={numpy}") + if self.build_type.lower() == 'debug': cmake_cmd.append(f"-DPYTHON_DEBUG_LIBRARY={self.py_library}") |
