Imported Upstream version 3.25.0
[platform/upstream/cmake.git] / Tests / RunCMake / try_compile / CxxStandardGNU.cmake
1 include(${CMAKE_CURRENT_SOURCE_DIR}/${try_compile_DEFS})
2
3 enable_language(CXX)
4
5 try_compile(result ${try_compile_bindir_or_SOURCES}
6   ${try_compile_redundant_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/CxxStandardGNU.cxx
7   CXX_STANDARD 11
8   CXX_STANDARD_REQUIRED 1
9   CXX_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_CXX_STANDARD 11)
20 set(CMAKE_CXX_STANDARD_REQUIRED 1)
21 set(CMAKE_CXX_EXTENSIONS 0)
22
23 try_compile(result ${try_compile_bindir_or_SOURCES}
24   ${try_compile_redundant_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/CxxStandardGNU.cxx
25   OUTPUT_VARIABLE out
26   )
27
28 if(NOT result)
29   message(FATAL_ERROR "try_compile failed:\n${out}")
30 endif()