You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently (r6257) (and apparently, ever since the first commit), engine/client/snd_dma.c includes opus.h like this
#include "opus.h"
The problem is that opus.h is usually distributed inside a directory named opus, so including it like that breaks the compilation. FTE deals with the problem by adding that opus directory as an additional include directory in the Makefile . It works. Kinda...
Including the header like that will only work on systems that stores opus headers inside /usr/include/opus. The build will break on any systems that store headers somewhere else.
If instead we included the header like this
#include <opus/opus.h>
Not only we could simplify the Makefile by removing the additional header directory it adds for opus, but the build would also work on any system, no matter where the system headers are stored.
it SHOULD be using pkg-config instead, like the cmake stuff indirectly does.
(unfortunately I get lazy, and pkg-config isn't always available either, especially when cross-compiling, and frankly we only need the headers anyway so using the host system's version of the headers is generally fine anyway.)
$ pkg-config --cflags opus -I/usr/include/opus
forcing it inside the C code potentially prevents fixing it up with CFLAGS (eg: if the required file is /usr/include/opus-VERSION/opus.h instead).
https://sourceforge.net/p/fteqw/tickets/148/
ferneu1 wrote on 2022-05-30:
Currently (r6257) (and apparently, ever since the first commit), engine/client/snd_dma.c includes
opus.h
like thisThe problem is that
opus.h
is usually distributed inside a directory namedopus
, so including it like that breaks the compilation. FTE deals with the problem by adding thatopus
directory as an additional include directory in the Makefile . It works. Kinda...Including the header like that will only work on systems that stores opus headers inside
/usr/include/opus
. The build will break on any systems that store headers somewhere else.If instead we included the header like this
Not only we could simplify the Makefile by removing the additional header directory it adds for opus, but the build would also work on any system, no matter where the system headers are stored.
I've attached a simple patch that does that.
1 Attachments
00-opus.include.patch
The text was updated successfully, but these errors were encountered: