[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / flang / runtime / CMakeLists.txt
blob005df3b86332bb964c4a6b74bda193bfa4ac8782
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(
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)
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.")
25 endif()
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
35   allocatable.cpp
36   buffer.cpp
37   character.cpp
38   connection.cpp
39   derived.cpp
40   descriptor.cpp
41   edit-input.cpp
42   edit-output.cpp
43   environment.cpp
44   file.cpp
45   format.cpp
46   internal-unit.cpp
47   iostat.cpp
48   io-api.cpp
49   io-error.cpp
50   io-stmt.cpp
51   main.cpp
52   memory.cpp
53   stat.cpp
54   stop.cpp
55   terminator.cpp
56   tools.cpp
57   transformational.cpp
58   type-code.cpp
59   unit.cpp
60   unit-map.cpp
62   LINK_LIBS
63   FortranDecimal