slembcke / Chipmunk2D

A fast and lightweight 2D game physics library.
http://chipmunk2d.net
MIT License
2.22k stars 352 forks source link

tcc compatibility #210

Closed larpon closed 3 years ago

larpon commented 3 years ago

I've written a wrapper for V/vlang which works fine with gcc and clang - but now I'm trying to compile Chipmunk2D with (the blazing fast) tcc (the default compiler shipped with V)

CC=tcc cmake
-- The C compiler identification is TinyCC
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/tcc
-- Check for working C compiler: /usr/bin/tcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Configuring Chipmunk2D version 7.0.3
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so   
-- Configuring done
-- Generating done

make
Scanning dependencies of target chipmunk_static
[  1%] Building C object src/CMakeFiles/chipmunk_static.dir/chipmunk.c.o
[  2%] Building C object src/CMakeFiles/chipmunk_static.dir/cpArbiter.c.o
[  3%] Building C object src/CMakeFiles/chipmunk_static.dir/cpArray.c.o
[  4%] Building C object src/CMakeFiles/chipmunk_static.dir/cpBBTree.c.o
[  5%] Building C object src/CMakeFiles/chipmunk_static.dir/cpBody.c.o
[  6%] Building C object src/CMakeFiles/chipmunk_static.dir/cpCollision.c.o
[  7%] Building C object src/CMakeFiles/chipmunk_static.dir/cpConstraint.c.o
[  8%] Building C object src/CMakeFiles/chipmunk_static.dir/cpDampedRotarySpring.c.o
[  9%] Building C object src/CMakeFiles/chipmunk_static.dir/cpDampedSpring.c.o
[ 10%] Building C object src/CMakeFiles/chipmunk_static.dir/cpGearJoint.c.o
[ 11%] Building C object src/CMakeFiles/chipmunk_static.dir/cpGrooveJoint.c.o
[ 12%] Building C object src/CMakeFiles/chipmunk_static.dir/cpHashSet.c.o
[ 13%] Building C object src/CMakeFiles/chipmunk_static.dir/cpHastySpace.c.o
[ 14%] Building C object src/CMakeFiles/chipmunk_static.dir/cpMarch.c.o
[ 15%] Building C object src/CMakeFiles/chipmunk_static.dir/cpPinJoint.c.o
[ 16%] Building C object src/CMakeFiles/chipmunk_static.dir/cpPivotJoint.c.o
[ 17%] Building C object src/CMakeFiles/chipmunk_static.dir/cpPolyShape.c.o
/home/user/vdev/chipmunk-dev/chipmunk-mod/c/Chipmunk2D/src/cpPolyShape.c:240: error: index too large
src/CMakeFiles/chipmunk_static.dir/build.make:446: recipe for target 'src/CMakeFiles/chipmunk_static.dir/cpPolyShape.c.o' failed

It'd be super awesome if we could get Chipmunk2D compiling with tcc somehow - especially because compile times would improve dramatically

slembcke commented 3 years ago

Sorry about the delay, but thanks for the pull request!

larpon commented 3 years ago

No problem 🙂 Thanks for pulling it in!