173
|
1 #===-- runtime/CMakeLists.txt ----------------------------------------------===#
|
|
2 #
|
|
3 # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
4 # See https://llvm.org/LICENSE.txt for license information.
|
|
5 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
6 #
|
|
7 #===------------------------------------------------------------------------===#
|
|
8
|
|
9 include(CheckCXXSymbolExists)
|
|
10 include(CheckCXXSourceCompiles)
|
|
11 check_cxx_symbol_exists(strerror string.h HAVE_STRERROR)
|
|
12 check_cxx_symbol_exists(strerror_r string.h HAVE_STRERROR_R)
|
|
13 # Can't use symbol exists here as the function is overloaded in C++
|
|
14 check_cxx_source_compiles(
|
|
15 "#include <string.h>
|
|
16 int main() {
|
|
17 char buf[4096];
|
|
18 return strerror_s(buf, 4096, 0);
|
|
19 }
|
|
20 "
|
|
21 HAVE_DECL_STRERROR_S)
|
|
22
|
|
23 if (NOT (HAVE_STRERROR OR HAVE_STRERROR_R OR HAVE_DECL_STRERROR_S))
|
|
24 message(FATAL_ERROR "None of strerror, strerror_r, strerror_s found.")
|
|
25 endif()
|
|
26
|
|
27 configure_file(config.h.cmake config.h)
|
|
28
|
|
29 add_flang_library(FortranRuntime
|
|
30 ISO_Fortran_binding.cpp
|
|
31 allocatable.cpp
|
|
32 buffer.cpp
|
|
33 character.cpp
|
|
34 connection.cpp
|
|
35 derived-type.cpp
|
|
36 descriptor.cpp
|
|
37 edit-input.cpp
|
|
38 edit-output.cpp
|
|
39 environment.cpp
|
|
40 file.cpp
|
|
41 format.cpp
|
|
42 internal-unit.cpp
|
|
43 iostat.cpp
|
|
44 io-api.cpp
|
|
45 io-error.cpp
|
|
46 io-stmt.cpp
|
|
47 main.cpp
|
|
48 memory.cpp
|
|
49 stop.cpp
|
|
50 terminator.cpp
|
|
51 tools.cpp
|
|
52 transformational.cpp
|
|
53 type-code.cpp
|
|
54 unit.cpp
|
|
55 unit-map.cpp
|
|
56
|
|
57 LINK_LIBS
|
|
58 FortranDecimal
|
|
59 )
|