2019-12-21 04:52:07 +08:00
|
|
|
#===-- runtime/CMakeLists.txt ----------------------------------------------===#
|
2018-05-17 01:22:33 +08:00
|
|
|
#
|
2019-12-21 04:52:07 +08:00
|
|
|
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
# See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2018-05-17 01:22:33 +08:00
|
|
|
#
|
2020-01-11 04:12:03 +08:00
|
|
|
#===------------------------------------------------------------------------===#
|
2018-05-17 01:22:33 +08:00
|
|
|
|
2020-03-13 04:28:35 +08:00
|
|
|
include(CheckCXXSymbolExists)
|
|
|
|
include(CheckCXXSourceCompiles)
|
|
|
|
check_cxx_symbol_exists(strerror string.h HAVE_STRERROR)
|
|
|
|
check_cxx_symbol_exists(strerror_r string.h HAVE_STRERROR_R)
|
|
|
|
# Can't use symbol exists here as the function is overloaded in C++
|
|
|
|
check_cxx_source_compiles(
|
|
|
|
"#include <string.h>
|
|
|
|
int main() {
|
|
|
|
char buf[4096];
|
|
|
|
return strerror_s(buf, 4096, 0);
|
|
|
|
}
|
|
|
|
"
|
|
|
|
HAVE_DECL_STRERROR_S)
|
|
|
|
|
|
|
|
if (NOT (HAVE_STRERROR OR HAVE_STRERROR_R OR HAVE_DECL_STRERROR_S))
|
|
|
|
message(FATAL_ERROR "None of strerror, strerror_r, strerror_s found.")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
configure_file(config.h.cmake config.h)
|
2020-06-09 03:13:58 +08:00
|
|
|
# include_directories is used here instead of target_include_directories
|
|
|
|
# because add_flang_library creates multiple objects (STATIC/SHARED, OBJECT)
|
|
|
|
# with different names
|
|
|
|
include_directories(AFTER ${CMAKE_CURRENT_BINARY_DIR})
|
2020-03-13 04:28:35 +08:00
|
|
|
|
2020-04-16 20:34:17 +08:00
|
|
|
add_flang_library(FortranRuntime
|
2020-01-28 10:18:45 +08:00
|
|
|
ISO_Fortran_binding.cpp
|
2020-03-31 07:37:30 +08:00
|
|
|
allocatable.cpp
|
2020-01-24 08:59:27 +08:00
|
|
|
buffer.cpp
|
2020-03-31 07:37:30 +08:00
|
|
|
character.cpp
|
2020-02-05 08:55:45 +08:00
|
|
|
connection.cpp
|
2020-01-28 10:18:45 +08:00
|
|
|
derived-type.cpp
|
|
|
|
descriptor.cpp
|
2020-02-14 06:41:56 +08:00
|
|
|
edit-input.cpp
|
|
|
|
edit-output.cpp
|
2020-01-24 08:59:27 +08:00
|
|
|
environment.cpp
|
2020-01-28 10:18:45 +08:00
|
|
|
file.cpp
|
|
|
|
format.cpp
|
2020-02-05 08:55:45 +08:00
|
|
|
internal-unit.cpp
|
2020-02-14 06:41:56 +08:00
|
|
|
iostat.cpp
|
2020-01-28 10:18:45 +08:00
|
|
|
io-api.cpp
|
|
|
|
io-error.cpp
|
|
|
|
io-stmt.cpp
|
|
|
|
main.cpp
|
|
|
|
memory.cpp
|
|
|
|
stop.cpp
|
|
|
|
terminator.cpp
|
|
|
|
tools.cpp
|
|
|
|
transformational.cpp
|
|
|
|
type-code.cpp
|
2020-01-24 08:59:27 +08:00
|
|
|
unit.cpp
|
2020-02-14 06:41:56 +08:00
|
|
|
unit-map.cpp
|
2020-03-13 04:28:35 +08:00
|
|
|
|
2020-04-16 20:34:17 +08:00
|
|
|
LINK_LIBS
|
2020-01-17 05:51:25 +08:00
|
|
|
FortranDecimal
|
2018-08-03 02:45:11 +08:00
|
|
|
)
|