[libcalamares] repair boost / pybind split

The difference wasn't being recorded in the ABI-parts of
the CalamaresConfig.h header file, and it was unclear if
the two builds were "clean", e.g. no pybind11 stuff in a
boost build and vice-versa.

Tidy that up by writing more ABI info to the header and
double-checking defines when including Python-related
Calamares headers.
This commit is contained in:
Adriaan de Groot 2024-02-24 13:27:44 +01:00
parent 34888edae1
commit be5ce2e60f
8 changed files with 14 additions and 8 deletions

View File

@ -94,4 +94,6 @@ include(CalamaresAddPlugin)
# This list should match the one in libcalamares/CalamaresConfig.h,
# which is the C++-language side of the same configuration.
set(Calamares_WITH_PYTHON @WITH_PYTHON@)
set(Calamares_WITH_PYBIND11 @WITH_PYBIND11@)
set(Calamares_WITH_QML @WITH_QML@)
set(Calamares_WITH_QT6 @WITH_QT6@)

View File

@ -34,7 +34,7 @@
// - Python support with older Boost implementation
// - QML support
#ifdef WITH_PYTHON
#if WITH_PYBIND11
#ifdef WITH_PYBIND11
#include "python/PythonJob.h"
#else
#include "PythonJob.h"
@ -486,7 +486,7 @@ main( int argc, char* argv[] )
#ifdef WITH_PYTHON
if ( module.m_pythonInjection )
{
#if WITH_PYBIND11
#ifdef WITH_PYBIND11
Calamares::Python::Job::setInjectedPreScript( pythonPreScript );
#else
// Old Boost approach

View File

@ -25,6 +25,8 @@
* which is the CMake-time side of the same configuration.
*/
#cmakedefine WITH_PYTHON
#cmakedefine WITH_PYBIND11
#cmakedefine WITH_QML
#cmakedefine WITH_QT6
#endif // CALAMARESCONFIG_H

View File

@ -19,7 +19,7 @@
#include <QDir>
#if WITH_PYBIND11
#ifdef WITH_PYBIND11
#error Source only for Boost::Python
#else
#endif

View File

@ -19,7 +19,7 @@
#include <memory>
#if WITH_PYBIND11
#ifdef WITH_PYBIND11
#error Source only for Boost::Python
#else
#endif

View File

@ -20,7 +20,7 @@
#include <QFileInfo>
#include <QString>
#if WITH_PYBIND11
#ifdef WITH_PYBIND11
#else
#error Source only for pybind11
#endif

View File

@ -11,7 +11,9 @@
#define CALAMARES_PYTHON_PYTHONJOB_H
// This file is called PythonJob.h because it would otherwise
// clashwith the Job.h in libcalamares proper.
// clash with the Job.h in libcalamares proper.
#include "CalamaresConfig.h"
#include "DllMacro.h"
#include "Job.h"
@ -19,7 +21,7 @@
#include <memory>
#if WITH_PYBIND11
#ifdef WITH_PYBIND11
#else
#error Source only for pybind11
#endif

View File

@ -10,7 +10,7 @@
#include "PythonJobModule.h"
#if WITH_PYBIND11
#ifdef WITH_PYBIND11
#include "python/PythonJob.h"
using JobType = Calamares::Python::Job;
#else