mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2024-10-26 07:55:06 +03:00
generator.py: Drop build/ prefix from #include
When -Ibuild flag is passed to compiler then build/ can be dropped from includes. This is safe to do, because the prefix is only on local includes (#include "") not system ones (#include <>). Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
dcd4218837
commit
a6b8929083
@ -892,7 +892,7 @@ def emit_c_code(module: str) -> None:
|
||||
wrapper.write("#include <Python.h>\n")
|
||||
wrapper.write("#include <libvirt/%s.h>\n" % (module,))
|
||||
wrapper.write("#include \"typewrappers.h\"\n")
|
||||
wrapper.write("#include \"%s/%s.h\"\n\n" % (buildDir, module))
|
||||
wrapper.write("#include \"%s.h\"\n\n" % (module))
|
||||
|
||||
for function in sorted(functions):
|
||||
if print_function_wrapper(package, function, wrapper, export, include):
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include <libvirt/virterror.h>
|
||||
#include "typewrappers.h"
|
||||
#include "libvirt-utils.h"
|
||||
#include "build/libvirt-lxc.h"
|
||||
#include "libvirt-lxc.h"
|
||||
|
||||
#ifndef __CYGWIN__
|
||||
extern PyObject *PyInit_libvirtmod_lxc(void);
|
||||
@ -94,7 +94,7 @@ libvirt_lxc_virDomainLxcOpenNamespace(PyObject *self ATTRIBUTE_UNUSED,
|
||||
* *
|
||||
************************************************************************/
|
||||
static PyMethodDef libvirtLxcMethods[] = {
|
||||
#include "build/libvirt-lxc-export.c.inc"
|
||||
#include "libvirt-lxc-export.c.inc"
|
||||
{(char *) "virDomainLxcOpenNamespace", libvirt_lxc_virDomainLxcOpenNamespace, METH_VARARGS, NULL},
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include <libvirt/virterror.h>
|
||||
#include <stddef.h>
|
||||
#include "typewrappers.h"
|
||||
#include "build/libvirt.h"
|
||||
#include "libvirt.h"
|
||||
#include "libvirt-utils.h"
|
||||
|
||||
#ifndef __CYGWIN__
|
||||
@ -10930,7 +10930,7 @@ libvirt_virDomainFDAssociate(PyObject *self ATTRIBUTE_UNUSED,
|
||||
* *
|
||||
************************************************************************/
|
||||
static PyMethodDef libvirtMethods[] = {
|
||||
#include "build/libvirt-export.c.inc"
|
||||
#include "libvirt-export.c.inc"
|
||||
{(char *) "virGetVersion", libvirt_virGetVersion, METH_VARARGS, NULL},
|
||||
{(char *) "virConnectGetVersion", libvirt_virConnectGetVersion, METH_VARARGS, NULL},
|
||||
#if LIBVIR_CHECK_VERSION(1, 1, 3)
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <libvirt/virterror.h>
|
||||
#include "typewrappers.h"
|
||||
#include "libvirt-utils.h"
|
||||
#include "build/libvirt-qemu.h"
|
||||
#include "libvirt-qemu.h"
|
||||
#ifndef __CYGWIN__
|
||||
# include <fcntl.h>
|
||||
#endif
|
||||
@ -447,7 +447,7 @@ libvirt_qemu_virDomainQemuMonitorCommandWithFiles(PyObject *self ATTRIBUTE_UNUSE
|
||||
* *
|
||||
************************************************************************/
|
||||
static PyMethodDef libvirtQemuMethods[] = {
|
||||
#include "build/libvirt-qemu-export.c.inc"
|
||||
#include "libvirt-qemu-export.c.inc"
|
||||
{(char *) "virDomainQemuMonitorCommand", libvirt_qemu_virDomainQemuMonitorCommand, METH_VARARGS, NULL},
|
||||
#if LIBVIR_CHECK_VERSION(0, 10, 0)
|
||||
{(char *) "virDomainQemuAgentCommand", libvirt_qemu_virDomainQemuAgentCommand, METH_VARARGS, NULL},
|
||||
|
1
setup.py
1
setup.py
@ -87,6 +87,7 @@ def get_module_lists():
|
||||
ldflags = get_pkgconfig_data(["--libs-only-L"], "libvirt", False).split()
|
||||
cflags = get_pkgconfig_data(["--cflags"], "libvirt", False).split()
|
||||
|
||||
cflags += ["-Ibuild"]
|
||||
cflags += ["-Wp,-DPy_LIMITED_API=0x03060000"]
|
||||
|
||||
module = Extension("libvirtmod",
|
||||
|
Loading…
Reference in New Issue
Block a user