From 34888edae140c7c6276ec752d3f752b827a27dcc Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sat, 24 Feb 2024 12:45:20 +0100 Subject: [PATCH] [libcalamares] repair visibility also for Boost::Python modules --- src/libcalamares/PythonHelper.h | 19 ++++++++++--------- src/libcalamares/PythonJob.cpp | 5 +++++ src/libcalamares/PythonJob.h | 11 ++++++++--- src/libcalamares/python/PythonJob.cpp | 5 +++++ src/libcalamares/python/PythonJob.h | 5 +++++ 5 files changed, 33 insertions(+), 12 deletions(-) diff --git a/src/libcalamares/PythonHelper.h b/src/libcalamares/PythonHelper.h index 121806862..f307894f0 100644 --- a/src/libcalamares/PythonHelper.h +++ b/src/libcalamares/PythonHelper.h @@ -11,6 +11,7 @@ #ifndef CALAMARES_PYTHONJOBHELPER_H #define CALAMARES_PYTHONJOBHELPER_H +#include "DllMacro.h" #include "PythonJob.h" #include "utils/BoostPython.h" @@ -24,20 +25,20 @@ class GlobalStorage; namespace CalamaresPython { -boost::python::object variantToPyObject( const QVariant& variant ); -QVariant variantFromPyObject( const boost::python::object& pyObject ); +DLLEXPORT boost::python::object variantToPyObject( const QVariant& variant ); +DLLEXPORT QVariant variantFromPyObject( const boost::python::object& pyObject ); -boost::python::list variantListToPyList( const QVariantList& variantList ); -QVariantList variantListFromPyList( const boost::python::list& pyList ); +DLLEXPORT boost::python::list variantListToPyList( const QVariantList& variantList ); +DLLEXPORT QVariantList variantListFromPyList( const boost::python::list& pyList ); -boost::python::dict variantMapToPyDict( const QVariantMap& variantMap ); -QVariantMap variantMapFromPyDict( const boost::python::dict& pyDict ); +DLLEXPORT boost::python::dict variantMapToPyDict( const QVariantMap& variantMap ); +DLLEXPORT QVariantMap variantMapFromPyDict( const boost::python::dict& pyDict ); -boost::python::dict variantHashToPyDict( const QVariantHash& variantHash ); -QVariantHash variantHashFromPyDict( const boost::python::dict& pyDict ); +DLLEXPORT boost::python::dict variantHashToPyDict( const QVariantHash& variantHash ); +DLLEXPORT QVariantHash variantHashFromPyDict( const boost::python::dict& pyDict ); -class Helper : public QObject +class DLLEXPORT Helper : public QObject { Q_OBJECT public: diff --git a/src/libcalamares/PythonJob.cpp b/src/libcalamares/PythonJob.cpp index ed05d5a92..2496a2c25 100644 --- a/src/libcalamares/PythonJob.cpp +++ b/src/libcalamares/PythonJob.cpp @@ -19,6 +19,11 @@ #include +#if WITH_PYBIND11 +#error Source only for Boost::Python +#else +#endif + static const char* s_preScript = nullptr; namespace bp = boost::python; diff --git a/src/libcalamares/PythonJob.h b/src/libcalamares/PythonJob.h index 5a9aed79f..7a130b7bc 100644 --- a/src/libcalamares/PythonJob.h +++ b/src/libcalamares/PythonJob.h @@ -11,7 +11,7 @@ #ifndef CALAMARES_PYTHONJOB_H #define CALAMARES_PYTHONJOB_H -#include "DllExport.h" +#include "DllMacro.h" #include "Job.h" #include "modulesystem/InstanceKey.h" @@ -19,6 +19,11 @@ #include +#if WITH_PYBIND11 +#error Source only for Boost::Python +#else +#endif + namespace CalamaresPython { class PythonJobInterface; @@ -28,11 +33,11 @@ class Helper; namespace Calamares { -class PythonJob : public Job +class DLLEXPORT PythonJob : public Job { Q_OBJECT public: - explicit DLLEXPORT PythonJob( const QString& scriptFile, + explicit PythonJob( const QString& scriptFile, const QString& workingPath, const QVariantMap& moduleConfiguration = QVariantMap(), QObject* parent = nullptr ); diff --git a/src/libcalamares/python/PythonJob.cpp b/src/libcalamares/python/PythonJob.cpp index 10c3e28ab..504699bb8 100644 --- a/src/libcalamares/python/PythonJob.cpp +++ b/src/libcalamares/python/PythonJob.cpp @@ -20,6 +20,11 @@ #include #include +#if WITH_PYBIND11 +#else +#error Source only for pybind11 +#endif + namespace py = pybind11; // Forward-declare function generated by PYBIND11_MODULE diff --git a/src/libcalamares/python/PythonJob.h b/src/libcalamares/python/PythonJob.h index 62f86d628..d1cb572ec 100644 --- a/src/libcalamares/python/PythonJob.h +++ b/src/libcalamares/python/PythonJob.h @@ -19,6 +19,11 @@ #include +#if WITH_PYBIND11 +#else +#error Source only for pybind11 +#endif + namespace Calamares { namespace Python