Page 1 of 1

Disabling use of CGPoint, CGFloat on Mac OS X

Posted: Sun Apr 01, 2012 5:19 pm
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.

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

Posted: Sun Apr 01, 2012 5:59 pm
by slembcke
Can you try the latest in GitHub? There was this fix recently:
https://github.com/jacekmigacz/Chipmunk ... 8006b24ca5

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

Posted: Sun Apr 01, 2012 6:11 pm
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.

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

Posted: Sun Apr 01, 2012 10:10 pm
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.