CheckPrototypeDefinition: Avoid if() auto-dereference
Convert from the old if(MATCHES) hack to if(DEFINED) to check whether the result variable is already set.
This commit is contained in:
parent
c9b301cd71
commit
3b5ea54a27
|
@ -57,7 +57,7 @@ get_filename_component(__check_proto_def_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||||
|
|
||||||
function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIABLE)
|
function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIABLE)
|
||||||
|
|
||||||
if ("${_VARIABLE}" MATCHES "^${_VARIABLE}$")
|
if (NOT DEFINED ${_VARIABLE})
|
||||||
set(CHECK_PROTOTYPE_DEFINITION_CONTENT "/* */\n")
|
set(CHECK_PROTOTYPE_DEFINITION_CONTENT "/* */\n")
|
||||||
|
|
||||||
set(CHECK_PROTOTYPE_DEFINITION_FLAGS ${CMAKE_REQUIRED_FLAGS})
|
set(CHECK_PROTOTYPE_DEFINITION_FLAGS ${CMAKE_REQUIRED_FLAGS})
|
||||||
|
|
Loading…
Reference in New Issue