[Spice-devel] [spice-server] build: Use <> rather than "" for including spice-server-enums.h

Christophe Fergeau cfergeau at redhat.com
Wed Aug 8 16:03:07 UTC 2018


On Wed, Aug 08, 2018 at 04:19:53PM +0200, Christophe Fergeau wrote:
> On Wed, Aug 08, 2018 at 07:13:28AM -0400, Frediano Ziglio wrote:
> > > 
> > > When using #include "spice-server-enums.h", it will be looked up first
> > > in the directory containing the file being build, which is going to be
> > > $srcdir when dcc.c includes it. However, spice-server-enums.h is a
> > > generated file, so it will be in $builddir, not in $srcdir. This most of
> > > the time won't be causing any problems, except when you happen to have
> > > an invalid spice-server-enums.h in $srcdir and you are doing an
> > > out-of-tree build.
> > > Using #include <spice-server-enums.h> instead allows the correct
> > > spice-server-enums.h file to be looked up.
> > > 
> > > Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
> > > ---
> > >  server/dcc.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/server/dcc.c b/server/dcc.c
> > > index 0468e7213..826dd28fe 100644
> > > --- a/server/dcc.c
> > > +++ b/server/dcc.c
> > > @@ -24,7 +24,7 @@
> > >  #include "display-channel-private.h"
> > >  #include "red-client.h"
> > >  #include "main-channel-client.h"
> > > -#include "spice-server-enums.h"
> > > +#include <spice-server-enums.h>
> > 
> > Maybe can be <server/spice-server-enums.h> ?
> > (didn't try, should be checked with both autoconf and meson).
> 
> Yup, <server/spice-server-enums.h> works too.

I pushed this commit after changing that, and this is causing
some issues with building from tarballs :-/
spice-server-enums.[ch] are shipped in tarballs, so in such build, it's
desirable to bee looking for the .h file in $srcdir. I guess we can just
revert this patch... No time for that now, I'll take a closer look
tomorrow.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20180808/97f88fe7/attachment.sig>


More information about the Spice-devel mailing list