]> code.ossystems Code Review - openembedded-core.git/commit
python3native, pythonnative: export PYTHON_LIBRARY and PYTHON_INCLUDE_DIR
authorKhem Raj <raj.khem@gmail.com>
Thu, 5 Sep 2019 00:22:11 +0000 (17:22 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 7 Sep 2019 06:47:14 +0000 (07:47 +0100)
commite45c06fe6f9a21c2cd06ae003cb112556382f81e
tree44e79d1d8b1526aaa0340323b3ab6f70aad0c38c
parentf7f04c4436f414ab1e57e7fc93349ac77ecf37be
python3native, pythonnative: export PYTHON_LIBRARY and PYTHON_INCLUDE_DIR

packages can use

find_package(PythonInterp REQUIRED)
find_package(PythonLibs REQUIRED)

while we control PYTHON pointing to native py3 the libs and include
directories will then point to build host version, which can result in
unexpected combination and if we are lucky we get errors if its quite
different e.g. py2 libs/includes and py3 executable

This variable can be then used to export PYTHON_LIBRARY and
PYTHON_INCLUDE_DIR so that above find_packages can work correctly

see [1] for how it happens in cmake

LLDB uses it see [2]

[1] https://github.com/Kitware/CMake/blob/master/Modules/FindPythonLibs.cmake
[2] https://github.com/llvm/llvm-project/blob/master/lldb/cmake/modules/LLDBConfig.cmake#L226

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/python3native.bbclass
meta/classes/pythonnative.bbclass