mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-07 06:09:52 -06:00
Features: Extend concept to C language.
Add properties and variables corresponding to CXX equivalents. Add features for c_function_prototypes (C90), c_restrict (C99), c_variadic_macros (C99) and c_static_assert (C11). This feature set can be extended later. Add a <PREFIX>_RESTRICT symbol define to WriteCompilerDetectionHeader to conditionally represent the c_restrict feature.
This commit is contained in:
@@ -8,7 +8,8 @@ Add expected compiler features to a target.
|
||||
target_compile_features(<target> <PRIVATE|PUBLIC|INTERFACE> <feature> [...])
|
||||
|
||||
Specify compiler features required when compiling a given target. If the
|
||||
feature is not listed in the :variable:`CMAKE_CXX_COMPILE_FEATURES` variable,
|
||||
feature is not listed in the :variable:`CMAKE_C_COMPILE_FEATURES` variable
|
||||
or :variable:`CMAKE_CXX_COMPILE_FEATURES` variable,
|
||||
then an error will be reported by CMake. If the use of the feature requires
|
||||
an additional compiler flag, such as ``-std=c++11``, the flag will be added
|
||||
automatically.
|
||||
|
||||
Reference in New Issue
Block a user