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:
parent
2e2c789385
commit
2108b1d195
1 changed files with 4 additions and 0 deletions
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue