summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CompileFeatures/generate_feature_list.cmake
blob: 09e17b114d1e4d0e31a64d8184bf445c28f0c38a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

enable_language(C)

file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/c_features.txt"
  "${CMAKE_C_COMPILE_FEATURES}"
)

file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cxx_features.txt"
  "${CMAKE_CXX_COMPILE_FEATURES}"
)

foreach(standard 98 11)
  set(CXX${standard}_FLAG NOTFOUND)
  if (DEFINED CMAKE_CXX${standard}_STANDARD_COMPILE_OPTION)
    set(CXX${standard}_FLAG ${CMAKE_CXX${standard}_STANDARD_COMPILE_OPTION})
  endif()

  file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cxx${standard}_flag.txt"
    "${CXX${standard}_FLAG}"
  )
  set(CXX${standard}EXT_FLAG NOTFOUND)
  if (DEFINED CMAKE_CXX${standard}_EXTENSION_COMPILE_OPTION)
    set(CXX${standard}EXT_FLAG ${CMAKE_CXX${standard}_EXTENSION_COMPILE_OPTION})
  endif()

  file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cxx${standard}ext_flag.txt"
    "${CXX${standard}EXT_FLAG}"
  )
endforeach()