[flang] Fix issue of flang/runtime/config.h not being found in out of tree builds
authorIsuru Fernando <isuruf@gmail.com>
Mon, 8 Jun 2020 19:13:58 +0000 (14:13 -0500)
committerIsuru Fernando <isuruf@gmail.com>
Mon, 8 Jun 2020 19:16:08 +0000 (14:16 -0500)
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

index 7da1a21..5f0a1e2 100644 (file)
@@ -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