summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/target_compile_features/no_matching_c_feature.cmake
blob: 0e93b41ffcf4d911dbbe0a1baedf6918c79b3f73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
enable_language(CXX)

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
)