1 #===-- runtime/CMakeLists.txt ----------------------------------------------===#
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
7 #===------------------------------------------------------------------------===#
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(
18 return strerror_s(buf, 4096, 0);
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.")
27 configure_file(config.h.cmake config.h)
28 # 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
31 include_directories(AFTER ${CMAKE_CURRENT_BINARY_DIR})
33 add_flang_library(FortranRuntime
34 ISO_Fortran_binding.cpp