[CMake] Supplying different debug flags during compile and link stages for libraries and executables

Brett Delle Grazie brett.dellegrazie at gmail.com
Wed Jun 27 16:36:41 EDT 2012


Hi,

On AIX using the XLC compiler I've determined the debug flag (-g)
should be used for all compile stages but should only be supplied to
the final
link stage of an executable (not a library target), otherwise
duplicate symbol errors result.
For reference see:
http://www.ibm.com/developerworks/forums/thread.jspa?threadID=438591&tstart=0

Is there an easy way of supplying a different set of debug flags for
the compile stage as opposed to the link stage?

I could potentially override:
CMAKE_C_FLAGS_DEBUG_INIT
CMAKE_CXX_FLAGS_DEBUG_INIT

but I can't really see where these are combined into the compile / link rules.

Does anyone have any suggestions? Any guidance / help is appreciated.

Thanks,

-- 
Best Regards,

Brett Delle Grazie


More information about the CMake mailing list