- Source code: cmake/modules/PHP/CheckAttribute.cmake
This module checks if GNU C function or variable attribute is supported by the C compiler:
include(PHP/CheckAttribute)
This module provides the following commands:
php_check_function_attribute(<attribute> <result-var>)
php_check_variable_attribute(<attribute> <result-var>)
-
<attribute>
Name of the attribute to check. -
<result-var>
Cache variable name to store the result of whether the C compiler supports the attribute<attribute>
.
Supported function attributes:
- ifunc
- target
- visibility
Supported variable attributes:
- aligned
Basic usage:
# CMakeLists.txt
include(PHP/CheckAttribute)
php_check_function_attribute(ifunc HAVE_FUNC_ATTRIBUTE_IFUNC)
php_check_variable_attribute(aligned HAVE_ATTRIBUTE_ALIGNED)