diff --git a/CMakeLists.txt b/CMakeLists.txt index 492a966..afc797a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 )