| 1 |
include(CheckPrototypeDefinition) |
| 2 |
|
| 3 |
function(check_prototype_definition_safe function prototype return header variable) |
| 4 |
# temporarily save CMAKE_C_FLAGS and disable warnings about unused |
| 5 |
# unused functions and parameters, otherwise they will always fail |
| 6 |
# if ENABLE_WERROR is on |
| 7 |
set(SAVED_CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") |
| 8 |
|
| 9 |
disable_warnings(unused-function) |
| 10 |
disable_warnings(unused-parameter) |
| 11 |
|
| 12 |
check_prototype_definition("${function}" "${prototype}" "${return}" "${header}" "${variable}") |
| 13 |
|
| 14 |
# restore CMAKE_C_FLAGS |
| 15 |
set(CMAKE_C_FLAGS "${SAVED_CMAKE_C_FLAGS}") |
| 16 |
endfunction() |