Closed Gottox closed 7 years ago
The yajl library bundled in C-Dogs SDL is different from upstream; make sure you are building against that.
Without a system Yajl, I get the following:
...
[ 61%] Building C object src/cdogs/CMakeFiles/cdogs.dir/draw/char_sprites.c.o
cd /builddir/cdogs-sdl-0.6.4/build/src/cdogs && /usr/lib/ccache/bin/cc -DNDEBUG -DPB_FIELD_16BIT -DSTATIC -I/builddir/cdogs-sdl-0.6.4/src/cdogs/enet/include -I/builddir/cdogs-sdl-0.6.4/src/cdogs/proto/nanopb -I/builddir/cdogs-sdl-0.6.4/src -I/builddir/cdogs-sdl-0.6.4/src/cdogs -I/builddir/cdogs-sdl-0.6.4/src/. -I/usr/include/SDL2 -specs=/void-packages/common/environment/configure/gccspecs/hardened-cc1 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -mtune=generic -O2 -pipe -g -O3 -DNDEBUG -fsigned-char -Wall -W -Wno-deprecated-declarations -Wstrict-prototypes -Wpointer-arith -Wcast-qual -O2 -freg-struct-return -std=gnu99 -Wshadow -Winline -Werror -o CMakeFiles/cdogs.dir/draw/char_sprites.c.o -c /builddir/cdogs-sdl-0.6.4/src/cdogs/draw/char_sprites.c
In file included from /builddir/cdogs-sdl-0.6.4/src/cdogs/draw/char_sprites.c:35:0:
/builddir/cdogs-sdl-0.6.4/src/cdogs/yajl_utils.h:31:28: fatal error: yajl/yajl_tree.h: No such file or directory
#include <yajl/yajl_tree.h>
^
compilation terminated.
make[2]: *** [src/cdogs/CMakeFiles/cdogs.dir/build.make:807: src/cdogs/CMakeFiles/cdogs.dir/draw/char_sprites.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/builddir/cdogs-sdl-0.6.4/build'
make[1]: *** [CMakeFiles/Makefile2:217: src/cdogs/CMakeFiles/cdogs.dir/all] Error 2
make[1]: Leaving directory '/builddir/cdogs-sdl-0.6.4/build'
make: *** [Makefile:161: all] Error 2
There are custom CFLAGS in the buildprocess, can they overwrite some of the includes needed for yajl?
when yajl builds, it should create the file src/cdogs/include/yajl/yajl_tree.h
, and the CMakeLists.txt file inside yajl adds this include folder to the include path, but your output shows that's not happening. I'm not sure why that would be, can you try doing a fresh build?
After a clean build:
find -name yajl_tree.h
./build/src/cdogs/include/yajl/yajl_tree.h
./src/cdogs/yajl/api/yajl_tree.h
I'm using mkdir build; cd build; cmake ..
to build. Could that cause the problem?
Try building in the base directory, i.e. cmake . && make
I think perhaps the culprit is this https://github.com/cxong/cdogs-sdl/blob/master/src/cdogs/yajl/CMakeLists.txt#L36
It probably should use CMAKE_CURRENT_SOURCE_DIR
, which happens to be the same as CMAKE_CURRENT_BINARY_DIR
if you build in source.
Oh, sh..., my mistake, my buildsystem applied a patch I forgot to remove. Nevermind!
See this buildlog: https://gist.github.com/Gottox/4e3e0e4e3e7bce70a58b740eecb3c32a
System: VoidLinux Kernel: Linux 4.9.13_1