mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 15:29:45 +03:00
py: libcamera: Move function declarations to common header
The init_py_*() functions are called by the top-level entry point of the libcamera Python module to initialize different parts of the bindings. They are declared in py_main.cpp where they are called, and defined in separate compilation units. This results in functions being defined without a corresponding declaration, and will generate warnings when we enable -Wmissing-declarations. Fix this by moving the function declarations from py_main.c to py_main.h, and including py_main.h in the various compilation units that need it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
885c48028f
commit
a2e27f4f2b
9 changed files with 24 additions and 8 deletions
|
@ -12,6 +12,8 @@
|
||||||
#include <pybind11/pybind11.h>
|
#include <pybind11/pybind11.h>
|
||||||
#include <pybind11/stl.h>
|
#include <pybind11/stl.h>
|
||||||
|
|
||||||
|
#include "py_main.h"
|
||||||
|
|
||||||
namespace py = pybind11;
|
namespace py = pybind11;
|
||||||
|
|
||||||
using namespace libcamera;
|
using namespace libcamera;
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
|
|
||||||
#include <pybind11/pybind11.h>
|
#include <pybind11/pybind11.h>
|
||||||
|
|
||||||
|
#include "py_main.h"
|
||||||
|
|
||||||
namespace py = pybind11;
|
namespace py = pybind11;
|
||||||
|
|
||||||
class PyControls
|
class PyControls
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
|
|
||||||
#include <pybind11/pybind11.h>
|
#include <pybind11/pybind11.h>
|
||||||
|
|
||||||
|
#include "py_main.h"
|
||||||
|
|
||||||
namespace py = pybind11;
|
namespace py = pybind11;
|
||||||
|
|
||||||
using namespace libcamera;
|
using namespace libcamera;
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
|
|
||||||
#include <pybind11/pybind11.h>
|
#include <pybind11/pybind11.h>
|
||||||
|
|
||||||
|
#include "py_main.h"
|
||||||
|
|
||||||
namespace py = pybind11;
|
namespace py = pybind11;
|
||||||
|
|
||||||
class PyFormats
|
class PyFormats
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
#include <pybind11/pybind11.h>
|
#include <pybind11/pybind11.h>
|
||||||
#include <pybind11/stl.h>
|
#include <pybind11/stl.h>
|
||||||
|
|
||||||
|
#include "py_main.h"
|
||||||
|
|
||||||
namespace py = pybind11;
|
namespace py = pybind11;
|
||||||
|
|
||||||
using namespace libcamera;
|
using namespace libcamera;
|
||||||
|
|
|
@ -85,14 +85,6 @@ PYBIND11_DECLARE_HOLDER_TYPE(T, PyCameraSmartPtr<T>)
|
||||||
*/
|
*/
|
||||||
static std::weak_ptr<PyCameraManager> gCameraManager;
|
static std::weak_ptr<PyCameraManager> gCameraManager;
|
||||||
|
|
||||||
void init_py_color_space(py::module &m);
|
|
||||||
void init_py_controls_generated(py::module &m);
|
|
||||||
void init_py_enums(py::module &m);
|
|
||||||
void init_py_formats_generated(py::module &m);
|
|
||||||
void init_py_geometry(py::module &m);
|
|
||||||
void init_py_properties_generated(py::module &m);
|
|
||||||
void init_py_transform(py::module &m);
|
|
||||||
|
|
||||||
PYBIND11_MODULE(_libcamera, m)
|
PYBIND11_MODULE(_libcamera, m)
|
||||||
{
|
{
|
||||||
init_py_enums(m);
|
init_py_enums(m);
|
||||||
|
|
|
@ -7,8 +7,18 @@
|
||||||
|
|
||||||
#include <libcamera/base/log.h>
|
#include <libcamera/base/log.h>
|
||||||
|
|
||||||
|
#include <pybind11/pybind11.h>
|
||||||
|
|
||||||
namespace libcamera {
|
namespace libcamera {
|
||||||
|
|
||||||
LOG_DECLARE_CATEGORY(Python)
|
LOG_DECLARE_CATEGORY(Python)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void init_py_color_space(pybind11::module &m);
|
||||||
|
void init_py_controls_generated(pybind11::module &m);
|
||||||
|
void init_py_enums(pybind11::module &m);
|
||||||
|
void init_py_formats_generated(pybind11::module &m);
|
||||||
|
void init_py_geometry(pybind11::module &m);
|
||||||
|
void init_py_properties_generated(pybind11::module &m);
|
||||||
|
void init_py_transform(pybind11::module &m);
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
|
|
||||||
#include <pybind11/pybind11.h>
|
#include <pybind11/pybind11.h>
|
||||||
|
|
||||||
|
#include "py_main.h"
|
||||||
|
|
||||||
namespace py = pybind11;
|
namespace py = pybind11;
|
||||||
|
|
||||||
class PyProperties
|
class PyProperties
|
||||||
|
|
|
@ -12,6 +12,8 @@
|
||||||
#include <pybind11/pybind11.h>
|
#include <pybind11/pybind11.h>
|
||||||
#include <pybind11/stl.h>
|
#include <pybind11/stl.h>
|
||||||
|
|
||||||
|
#include "py_main.h"
|
||||||
|
|
||||||
namespace py = pybind11;
|
namespace py = pybind11;
|
||||||
|
|
||||||
using namespace libcamera;
|
using namespace libcamera;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue