VS 2012 builds

36 views
Skip to first unread message

Paul Martz

unread,
Jun 2, 2013, 4:36:06 PM6/2/13
to osgbull...@googlegroups.com
I've just tried building Bullet / osgBullet with VS 2012 for the first time. Here are some tips that I hope will help others to avoid headaches.

Issue #1: Determining Bullet's use of double precision fails.

osgBullet's CMake does a try_compile for this check, but the compile / link fails regardless of bei9ng built for double- or single-precision Bullet. The root cause of the failure is that VS 2012 doesn't allow mixed usage of the C runtime libraries, and apparently previous versions of VS allowed this.

My fix was to go back to BUllet's CMake, set USE_MSVC_RUNTIME_LIBRARY_DLL to ON, and rebuild Bullet.

I'm not quite sure how we'd automatically determine whether BUllet was built with /MD or /MT, but I'm guessing we could do another try_compile specifically for that, then adjust the double precision try_compile to use the appropriate version of the runtime libraries. I'm not up to this at the moment, but I'll open an issue on the osgBullet Google Code page.

Issue #2: osgBUllet Debug build fails.

CMake's stock Bullet find script fails to find the debug version of the LinearMath library. This was not an issue in previous versions of VS, as the optimized LinearMath could be linked in to Debug builds, but VS 2012 doesn't tolerate this. The result is that osgBullet builds fine for Release, but fails for Debug.

The fix for this is to manually set the BULLET_MATH_LIBRARY_DEBUG variable in osgBullet's CMake. When using cmake-gui, you'll need to view "advanced" variables to see this.

As this is really a CMake bug and not an osgBullet bug, I'm not opening an issue for it. But if someone wants to submit a fix to the CMake project, I'd appreciate it. I'm using CMake 2.8.8; if this is fixed in a more recent version, please let me know, thanks.


--
Paul Martz
Skew Matrix Software LLC
Reply all
Reply to author
Forward
0 new messages