blob: c391cb2c9bd39a18493c4cef78e8d9b1370194e7 [file] [log] [blame]
Gary Klimowicz9e7548a2019-12-20 20:52:071#===-- runtime/CMakeLists.txt ----------------------------------------------===#
peter klausler6261c092018-05-16 17:22:332#
Gary Klimowicz9e7548a2019-12-20 20:52:073# 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
peter klausler6261c092018-05-16 17:22:336#
Gary Klimowiczcea10402020-01-10 20:12:037#===------------------------------------------------------------------------===#
peter klausler6261c092018-05-16 17:22:338
Isuru Fernandoea5efd12020-03-12 20:28:359include(CheckCXXSymbolExists)
10include(CheckCXXSourceCompiles)
11check_cxx_symbol_exists(strerror string.h HAVE_STRERROR)
12check_cxx_symbol_exists(strerror_r string.h HAVE_STRERROR_R)
13# Can't use symbol exists here as the function is overloaded in C++
14check_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
23if (NOT (HAVE_STRERROR OR HAVE_STRERROR_R OR HAVE_DECL_STRERROR_S))
24 message(FATAL_ERROR "None of strerror, strerror_r, strerror_s found.")
25endif()
26
27configure_file(config.h.cmake config.h)
Isuru Fernandobb73d1b2020-06-08 19:13:5828# include_directories is used here instead of target_include_directories
29# because add_flang_library creates multiple objects (STATIC/SHARED, OBJECT)
30# with different names
31include_directories(AFTER ${CMAKE_CURRENT_BINARY_DIR})
Isuru Fernandoea5efd12020-03-12 20:28:3532
Mehdi Chinoune2d6b9db2020-04-16 12:34:1733add_flang_library(FortranRuntime
Alexis Perry352d3472020-01-28 02:18:4534 ISO_Fortran_binding.cpp
peter klausler4d54bb72020-03-30 23:37:3035 allocatable.cpp
peter klauslerf7be2512020-01-24 00:59:2736 buffer.cpp
peter klauslere372e0f2021-03-31 16:14:0837 complex-reduction.c
peter klausler4d54bb72020-03-30 23:37:3038 character.cpp
peter klausler95696d52020-02-05 00:55:4539 connection.cpp
peter klausler4fede8b2020-12-07 22:46:2440 derived.cpp
Alexis Perry352d3472020-01-28 02:18:4541 descriptor.cpp
peter klausler3b635712020-02-13 22:41:5642 edit-input.cpp
43 edit-output.cpp
peter klauslerf7be2512020-01-24 00:59:2744 environment.cpp
Alexis Perry352d3472020-01-28 02:18:4545 file.cpp
46 format.cpp
peter klausler95696d52020-02-05 00:55:4547 internal-unit.cpp
peter klausler3b635712020-02-13 22:41:5648 iostat.cpp
Alexis Perry352d3472020-01-28 02:18:4549 io-api.cpp
50 io-error.cpp
51 io-stmt.cpp
52 main.cpp
53 memory.cpp
peter klausler78a39d22021-04-02 16:30:3154 misc-intrinsic.cpp
peter klausler5f6c5c62021-04-01 19:59:5955 numeric.cpp
peter klauslere1114042021-04-07 20:14:1456 random.cpp
peter klauslere372e0f2021-03-31 16:14:0857 reduction.cpp
peter klausler8df28f02020-11-10 23:13:0258 stat.cpp
Alexis Perry352d3472020-01-28 02:18:4559 stop.cpp
60 terminator.cpp
61 tools.cpp
62 transformational.cpp
63 type-code.cpp
peter klauslerf7be2512020-01-24 00:59:2764 unit.cpp
peter klausler3b635712020-02-13 22:41:5665 unit-map.cpp
peter klauslera8fed822018-08-02 18:45:1166
Mehdi Chinoune2d6b9db2020-04-16 12:34:1767 LINK_LIBS
peter klausler491122d2020-01-16 21:51:2568 FortranDecimal
peter klauslera8fed822018-08-02 18:45:1169)