cxong / cdogs-sdl

Classic overhead run-and-gun game
https://cxong.github.io/cdogs-sdl/
GNU General Public License v2.0
891 stars 114 forks source link

[v0.6.4] build fails at yajl #487

Closed Gottox closed 7 years ago

Gottox commented 7 years ago

See this buildlog: https://gist.github.com/Gottox/4e3e0e4e3e7bce70a58b740eecb3c32a

System: VoidLinux Kernel: Linux 4.9.13_1

cxong commented 7 years ago

The yajl library bundled in C-Dogs SDL is different from upstream; make sure you are building against that.

Gottox commented 7 years ago

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
Gottox commented 7 years ago

There are custom CFLAGS in the buildprocess, can they overwrite some of the includes needed for yajl?

cxong commented 7 years ago

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?

Gottox commented 7 years ago

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?

cxong commented 7 years ago

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.

Gottox commented 7 years ago

Oh, sh..., my mistake, my buildsystem applied a patch I forgot to remove. Nevermind!