Add some useful compiler flags for debug builds

git-svn-id: http://tint2.googlecode.com/svn/trunk@728 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
o9000 2015-03-18 19:54:48 +00:00 committed by mrovi9000@gmail.com
parent da7efb27a9
commit a8600a598b

View file

@ -98,6 +98,14 @@ if( ENABLE_TINT2CONF )
add_dependencies( tint2conf version )
endif( ENABLE_TINT2CONF )
if( CMAKE_BUILD_TYPE MATCHES Debug)
SET(DBG_C_FLAGS " -O0 -g3 -gdwarf-2 -fsanitize=address -fno-common -fno-omit-frame-pointer -rdynamic ")
SET(DBG_L_FLAGS " -O0 -g3 -gdwarf-2 -fsanitize=address -fno-common -fno-omit-frame-pointer -rdynamic ")
else()
SET(DBG_C_FLAGS "")
SET(DBG_L_FLAGS "")
endif()
set( MANDIR share/man CACHE PATH "Directory for man pages" )
set( DATADIR share CACHE PATH "Directory for shared data" )
set( SYSCONFDIR /etc CACHE PATH "Directory for configuration files" )
@ -131,8 +139,8 @@ endif( RT_LIBRARY )
target_link_libraries( tint2 m )
add_dependencies( tint2 version )
set_target_properties( tint2 PROPERTIES COMPILE_FLAGS "-Wall -pthread" )
set_target_properties( tint2 PROPERTIES LINK_FLAGS "-pthread" )
set_target_properties( tint2 PROPERTIES COMPILE_FLAGS "-Wall -pthread ${DBG_C_FLAGS}" )
set_target_properties( tint2 PROPERTIES LINK_FLAGS "-pthread ${DBG_L_FLAGS}" )
install( TARGETS tint2 DESTINATION bin )
install( FILES sample/tint2rc DESTINATION ${SYSCONFDIR}/xdg/tint2 )