libcalamares: use Pybind11Helpers consistently

This header includes all of the needed pybind11 headers,
but also wrangles defines and warnings in one spot.
This commit is contained in:
Adriaan de Groot 2023-10-24 22:13:06 +02:00
parent 019450132e
commit f24df7ccc9
4 changed files with 26 additions and 10 deletions

View File

@ -14,6 +14,7 @@
#include "compat/Variant.h"
#include "locale/Global.h"
#include "partition/Mount.h"
#include "python/Pybind11Helpers.h"
#include "python/PythonJob.h"
#include "utils/Logger.h"
#include "utils/RAII.h"
@ -26,10 +27,6 @@
#include <QDir>
#include <QStandardPaths>
#undef slots
#include <pybind11/embed.h>
#include <pybind11/pybind11.h>
namespace py = pybind11;
/** @namespace

View File

@ -18,8 +18,7 @@
#include "utils/Logger.h"
#undef slots
#include <pybind11/pybind11.h>
#include "python/Pybind11Helpers.h"
#include <string>

View File

@ -14,9 +14,27 @@
#include <string>
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcovered-switch-default"
#pragma clang diagnostic ignored "-Wfloat-equal"
#pragma clang diagnostic ignored "-Wweak-vtables"
#pragma clang diagnostic ignored "-Wmissing-variable-declarations"
#pragma clang diagnostic ignored "-Wold-style-cast"
#pragma clang diagnostic ignored "-Wshadow-uncaptured-local"
#pragma clang diagnostic ignored "-Wshadow-field-in-constructor"
#pragma clang diagnostic ignored "-Wshadow-field"
#pragma clang diagnostic ignored "-Wdocumentation"
#pragma clang diagnostic ignored "-Wmissing-noreturn"
#pragma clang diagnostic ignored "-Wreserved-identifier"
#endif
#undef slots
#include <pybind11/pybind11.h>
#include <pybind11/embed.h>
#include <pybind11/eval.h>
namespace Calamares
{
namespace Python __attribute__( ( visibility( "hidden" ) ) )
@ -35,4 +53,9 @@ namespace Python __attribute__( ( visibility( "hidden" ) ) )
} // namespace Python
} // namespace Calamares
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif

View File

@ -13,16 +13,13 @@
#include "JobQueue.h"
#include "python/Api.h"
#include "python/Logger.h"
#include "python/Pybind11Helpers.h"
#include "utils/Logger.h"
#include <QDir>
#include <QFileInfo>
#include <QString>
#undef slots
#include <pybind11/embed.h>
#include <pybind11/eval.h>
namespace py = pybind11;
namespace