Added cmake command line option to build with clang/gcc address sanitizer enabled.
This commit is contained in:
parent
1b32752800
commit
02bf3dbb4d
|
@ -85,6 +85,14 @@ else(WIN32)
|
||||||
#endif()
|
#endif()
|
||||||
add_definitions( -D__QT_DRIVER__ -DQT_DEPRECATED_WARNINGS )
|
add_definitions( -D__QT_DRIVER__ -DQT_DEPRECATED_WARNINGS )
|
||||||
|
|
||||||
|
if ( ${ASAN_ENABLE} )
|
||||||
|
add_definitions( -fsanitize=address -fsanitize=bounds-strict )
|
||||||
|
set( ASAN_LDFLAGS -lasan -lubsan)
|
||||||
|
message( STATUS "Address Sanitizer Enabled" )
|
||||||
|
else()
|
||||||
|
message( STATUS "Address Sanitizer Disabled" )
|
||||||
|
endif()
|
||||||
|
|
||||||
# Check for libminizip
|
# Check for libminizip
|
||||||
pkg_check_modules( MINIZIP REQUIRED minizip)
|
pkg_check_modules( MINIZIP REQUIRED minizip)
|
||||||
|
|
||||||
|
@ -613,7 +621,7 @@ add_executable( ${APP_NAME} ${SOURCES} ../resources.qrc
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/fceux_git_info.cpp)
|
${CMAKE_CURRENT_BINARY_DIR}/fceux_git_info.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries( ${APP_NAME}
|
target_link_libraries( ${APP_NAME} ${ASAN_LDFLAGS}
|
||||||
${${Qt}Widgets_LIBRARIES}
|
${${Qt}Widgets_LIBRARIES}
|
||||||
${${Qt}Help_LIBRARIES}
|
${${Qt}Help_LIBRARIES}
|
||||||
${${Qt}OpenGL_LIBRARIES}
|
${${Qt}OpenGL_LIBRARIES}
|
||||||
|
|
Loading…
Reference in New Issue