From bb73d1b278eb478ca8e56153cf1469bf7eb13a3f Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 8 Jun 2020 14:13:58 -0500 Subject: [PATCH] [flang] Fix issue of flang/runtime/config.h not being found in out of tree builds Summary: Fixes https://bugs.llvm.org/show_bug.cgi?id=46078 Reviewers: DavidTruby, jdoerfert, PeteSteinfeld, sscalpone, tskeith Reviewed By: PeteSteinfeld, sscalpone, tskeith Subscribers: mgorny, llvm-commits, tskeith Tags: #llvm, #flang Differential Revision: https://reviews.llvm.org/D81266 --- flang/runtime/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flang/runtime/CMakeLists.txt b/flang/runtime/CMakeLists.txt index 7da1a21..5f0a1e2 100644 --- a/flang/runtime/CMakeLists.txt +++ b/flang/runtime/CMakeLists.txt @@ -25,6 +25,10 @@ if (NOT (HAVE_STRERROR OR HAVE_STRERROR_R OR HAVE_DECL_STRERROR_S)) 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 -- 2.7.4