File tree 3 files changed +45
-4
lines changed
3 files changed +45
-4
lines changed Original file line number Diff line number Diff line change @@ -17,11 +17,12 @@ include(CheckSourceRuns)
17
17
18
18
# --- compiler checks
19
19
20
- foreach (i IN ITEMS f03abstract f03charalloc f03ieee f03utf8 f03selectType
21
- f08contig f08execute f08kind
22
- f18abstract f18assumed_rank f18prop f18random f2018rank
23
- f2023rank_integer f2023ternary f2023tokenize f2023real16)
20
+ set (f2003features f03abstract f03charalloc f03ieee f03utf8 f03selectType)
21
+ set (f2008features f08contig f08execute f08kind)
22
+ set (f2018features f18abstract f18assumed_rank f18prop f18random f2018rank)
23
+ set (f2023features f2023rank_integer f2023ternary f2023tokenize f2023real16)
24
24
25
+ foreach (i IN LISTS f2003features f2008features f2018features f2023features)
25
26
include (cmake/${i} .cmake)
26
27
endforeach ()
27
28
@@ -40,3 +41,5 @@ foreach(a IN ITEMS git system)
40
41
endforeach ()
41
42
42
43
file (GENERATE OUTPUT .gitignore CONTENT "*" )
44
+
45
+ include (cmake/features.cmake)
Original file line number Diff line number Diff line change
1
+ set (CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
2
+
3
+ check_source_compiles(Fortran "subroutine poly(A)
4
+ intrinsic :: rank
5
+ real, intent(in) :: A(:)
6
+ real :: B(rank(A))
7
+ B = A
8
+ end subroutine"
9
+ f2018rank)
Original file line number Diff line number Diff line change
1
+ set (j "{}" )
2
+
3
+ foreach (s IN LISTS f2003features f2008features f2018features f2023features)
4
+ foreach (f IN LISTS s)
5
+ if (${f} )
6
+ set (hasf true )
7
+ else ()
8
+ set (hasf false )
9
+ endif ()
10
+
11
+ string (JSON j SET ${j} ${f} ${hasf} )
12
+ endforeach ()
13
+ endforeach ()
14
+
15
+
16
+ string (JSON j SET ${j} compiler "{}" )
17
+ string (JSON j SET ${j} compiler vendor \"${CMAKE_Fortran_COMPILER_ID} \")
18
+ string (JSON j SET ${j} compiler version \"${CMAKE_Fortran_COMPILER_VERSION} \")
19
+ string (JSON j SET ${j} compiler system \"${CMAKE_SYSTEM_NAME} \")
20
+ string (JSON j SET ${j} compiler system_version \"${CMAKE_SYSTEM_VERSION} \")
21
+ string (JSON j SET ${j} compiler target \"${CMAKE_SYSTEM_PROCESSOR} \")
22
+ string (JSON j SET ${j} compiler flags \"${CMAKE_Fortran_FLAGS} \")
23
+ string (JSON j SET ${j} compiler sysroot \"${CMAKE_OSX_SYSROOT} \")
24
+
25
+ set (feature_file ${CMAKE_CURRENT_BINARY_DIR} /features.json)
26
+
27
+ file (WRITE ${feature_file} ${j} )
28
+
29
+ message (STATUS "See ${feature_file} for features enabled" )
You can’t perform that action at this time.
0 commit comments