e0890d03a4
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.
16 lines
326 B
CMake
16 lines
326 B
CMake
|
|
if (NOT ";${CMAKE_C_COMPILE_FEATURES};" MATCHES ";gnu_c_typeof;")
|
|
# Simulate passing the test.
|
|
message(SEND_ERROR
|
|
"The compiler feature \"gnu_c_dummy\" is not known to C compiler\n\"GNU\"\nversion 4.8.1."
|
|
)
|
|
return()
|
|
endif()
|
|
|
|
add_executable(main empty.c)
|
|
|
|
target_compile_features(main
|
|
PRIVATE
|
|
gnu_c_typeof
|
|
)
|