2019-12-20 20:52:07 +00:00
|
|
|
#===-- runtime/CMakeLists.txt ----------------------------------------------===#
|
2018-05-16 17:22:33 +00:00
|
|
|
#
|
2019-12-20 20:52:07 +00: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-16 17:22:33 +00:00
|
|
|
#
|
2020-01-10 20:12:03 +00:00
|
|
|
#===------------------------------------------------------------------------===#
|
2018-05-16 17:22:33 +00:00
|
|
|
|
2020-03-12 20:28:35 +00: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)
|
|
|
|
|
2019-01-19 23:30:25 +00:00
|
|
|
add_library(FortranRuntime
|
2020-01-28 02:18:45 +00:00
|
|
|
ISO_Fortran_binding.cpp
|
2020-03-30 23:37:30 +00:00
|
|
|
allocatable.cpp
|
2020-01-24 00:59:27 +00:00
|
|
|
buffer.cpp
|
2020-03-30 23:37:30 +00:00
|
|
|
character.cpp
|
2020-02-05 00:55:45 +00:00
|
|
|
connection.cpp
|
2020-01-28 02:18:45 +00:00
|
|
|
derived-type.cpp
|
|
|
|
descriptor.cpp
|
2020-02-13 22:41:56 +00:00
|
|
|
edit-input.cpp
|
|
|
|
edit-output.cpp
|
2020-01-24 00:59:27 +00:00
|
|
|
environment.cpp
|
2020-01-28 02:18:45 +00:00
|
|
|
file.cpp
|
|
|
|
format.cpp
|
2020-02-05 00:55:45 +00:00
|
|
|
internal-unit.cpp
|
2020-02-13 22:41:56 +00:00
|
|
|
iostat.cpp
|
2020-01-28 02:18:45 +00: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 00:59:27 +00:00
|
|
|
unit.cpp
|
2020-02-13 22:41:56 +00:00
|
|
|
unit-map.cpp
|
2018-05-16 17:22:33 +00:00
|
|
|
)
|
2018-08-02 18:45:11 +00:00
|
|
|
|
2020-03-12 20:28:35 +00:00
|
|
|
target_include_directories(FortranRuntime
|
|
|
|
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
)
|
|
|
|
|
2018-08-02 18:45:11 +00:00
|
|
|
target_link_libraries(FortranRuntime
|
2020-01-16 21:51:25 +00:00
|
|
|
FortranDecimal
|
2018-08-02 18:45:11 +00:00
|
|
|
)
|