1
0
Fork 0
mirror of https://github.com/albfan/miraclecast.git synced 2025-03-09 23:38:56 +00:00

add compiler flag to do sanity check of undefined behaviours.

This commit is contained in:
Derek Dai 2017-03-03 08:52:40 +08:00
parent 2e2c789385
commit 2108b1d195
No known key found for this signature in database
GPG key ID: E109CC97553EF009

View file

@ -27,6 +27,10 @@ check_c_compiler_flag(-fstack-protector-strong HAS_STACK_PROTCTOR_STRONG)
if(HAS_STACK_PROTCTOR_STRONG) if(HAS_STACK_PROTCTOR_STRONG)
set(CMAKE_C_FLAGS "-fstack-protector-strong ${CMAKE_C_FLAGS}") set(CMAKE_C_FLAGS "-fstack-protector-strong ${CMAKE_C_FLAGS}")
endif() endif()
check_c_compiler_flag(-fsanitize=undefined HAS_SANITIZE_UNDEFINED)
if(HAS_SANITIZE_UNDEFINED)
set(CMAKE_C_FLAGS "-fsanitize=undefined ${CMAKE_C_FLAGS}")
endif()
set(CMAKE_C_FLAGS "-std=gnu11 -Wall ${CMAKE_C_FLAGS}") set(CMAKE_C_FLAGS "-std=gnu11 -Wall ${CMAKE_C_FLAGS}")
add_definitions(-D_GNU_SOURCE) add_definitions(-D_GNU_SOURCE)