Disabling use of CGPoint, CGFloat on Mac OS X

Official forum for the Chipmunk2D Physics Library.
Post Reply
paul
Posts: 4
Joined: Sun Apr 01, 2012 4:52 pm
Contact:

Disabling use of CGPoint, CGFloat on Mac OS X

Post by paul »

Hi, I'm just starting some work on a Go wrapper for the library as part of a small project I'm working on. I'd like to disable use of CGPoint and CGFloat and just use the CP types but can't seem to get it working through the cmake -> make process. I tried using:

Code: Select all

cmake -D BUILD_DEMOS:BOOL=OFF -D CP_USE_CGPOINTS:BOOL=0 .
make
etc.
Then I tried with this flag:

Code: Select all

CMAKE_C_FLAGS:STRING="-DCP_USE_CGPOINTS=0"
But it still seems to be compiling CGPoint into the libraries as I get errors like this:

Code: Select all

cmunktest.go:16<SNIP>: cannot use x (type float64) as type _Ctype_CGFloat in field value
Is there any standard way to fully disable compiling with CGPoint?

Thanks for your help.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Disabling use of CGPoint, CGFloat on Mac OS X

Post by slembcke »

Can you try the latest in GitHub? There was this fix recently:
https://github.com/jacekmigacz/Chipmunk ... 8006b24ca5
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
paul
Posts: 4
Joined: Sun Apr 01, 2012 4:52 pm
Contact:

Re: Disabling use of CGPoint, CGFloat on Mac OS X

Post by paul »

In trying to make it work, I made the same edit (changing ifdef to if down at the bottom of the types header) but that doesn't seem to do it. Even with:

Code: Select all

CMAKE_C_FLAGS:STRING=-DCP_USE_CGPOINTS=0
It still manages to somehow end up using CGPoint. If I comment that condition out it doesn't use CGPoint but it's not a great solution (especially for updates down the road). I'm not super familiar with cmake so I might be missing something.
paul
Posts: 4
Joined: Sun Apr 01, 2012 4:52 pm
Contact:

Re: Disabling use of CGPoint, CGFloat on Mac OS X

Post by paul »

Ok, it turns out that the problem was that I missed a character in Go's cgo configuration to add the flag. My apologies for the wild goose chase. All is working well now.
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests