Reputation: 1258
I'm using a header only library for a project (glm) and am currently trying to debug some problems I'm having. I trust that glm is giving me the correct values, however it is dog slow when built without optimisations (I'm using visual studio 2012/2013/2010 whichever is easiest to do this in, as all 3 are installed).
Is there a way to enable optimisations (specifically /O2), and disable debug symbols for just the GLM header files, while retaining the debug information for the rest of the solution?
EDIT:
I'd like to throw in, that I'd rather not change libraries at this point, as it's almost at the end of the project and I have other things to do aswell, so rewriting to use Eigen/CML isn't really on the table.
Upvotes: 2
Views: 403
Reputation: 111
You can try:
1) Create one code file and include all headers you need.
2) Define all the template classes in this source file you want to use (e.g. "template ClassA;"
3) Compile this source File with optimization and link later against it.
4) Create a header file and declare all theses classes without the function definitions (simply copy the original header files and erase all functions definitions.)
5) Use this header file for your project.
Upvotes: 3