llvm/flang/runtime/CMakeLists.txt
Peter Klausler bafbae238a [flang] Initial UTF-8 support in runtime I/O
Implements UTF-8 encoding and decoding for external units
with OPEN(ENCODING='UTF-8').  This encoding applies to default
CHARACTER values that are not 7-bit ASCII as well as to
the wide CHARACTER kinds 2 and 4.  Basic testing is in place
via direct calls to the runtime I/O APIs, but serious checkout
awaits lowering support of the wide CHARACTER kinds.

Differential Revision: https://reviews.llvm.org/D122038
2022-03-22 11:48:14 -07:00

90 lines
2 KiB
CMake

#===-- runtime/CMakeLists.txt ----------------------------------------------===#
#
# 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
#
#===------------------------------------------------------------------------===#
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)
# 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})
add_flang_library(FortranRuntime
ISO_Fortran_binding.cpp
allocatable.cpp
assign.cpp
buffer.cpp
command.cpp
complex-reduction.c
copy.cpp
character.cpp
connection.cpp
derived.cpp
derived-api.cpp
descriptor.cpp
descriptor-io.cpp
dot-product.cpp
edit-input.cpp
edit-output.cpp
environment.cpp
extensions.cpp
extrema.cpp
file.cpp
findloc.cpp
format.cpp
inquiry.cpp
internal-unit.cpp
iostat.cpp
io-api.cpp
io-error.cpp
io-stmt.cpp
main.cpp
matmul.cpp
memory.cpp
misc-intrinsic.cpp
namelist.cpp
numeric.cpp
ragged.cpp
random.cpp
reduction.cpp
pointer.cpp
product.cpp
stat.cpp
stop.cpp
sum.cpp
support.cpp
terminator.cpp
time-intrinsic.cpp
tools.cpp
transformational.cpp
type-code.cpp
type-info.cpp
unit.cpp
unit-map.cpp
utf.cpp
LINK_LIBS
FortranDecimal
)