Imported Upstream version 3.25.0
[platform/upstream/cmake.git] / Tests / RunCMake / try_compile / CStandardGNU.cmake
1 include(${CMAKE_CURRENT_SOURCE_DIR}/${try_compile_DEFS})
2
3 enable_language(C)
4
5 try_compile(result ${try_compile_bindir_or_SOURCES}
6   ${try_compile_redundant_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/CStandardGNU.c
7   C_STANDARD 99
8   C_STANDARD_REQUIRED 1
9   C_EXTENSIONS 0
10   OUTPUT_VARIABLE out
11   )
12
13 if(NOT result)
14   message(FATAL_ERROR "try_compile failed:\n${out}")
15 endif()
16
17 cmake_policy(SET CMP0067 NEW)
18
19 set(CMAKE_C_STANDARD 99)
20 set(CMAKE_C_STANDARD_REQUIRED 1)
21 set(CMAKE_C_EXTENSIONS 0)
22
23 try_compile(result ${try_compile_bindir_or_SOURCES}
24   ${try_compile_redundant_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/CStandardGNU.c
25   OUTPUT_VARIABLE out
26   )
27
28 if(NOT result)
29   message(FATAL_ERROR "try_compile failed:\n${out}")
30 endif()