[flang-commits] [PATCH] D136606: [flang] Fix building against clang dylib

Michał Górny via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Oct 28 00:40:52 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG042382cbc42b: [flang] Fix building against clang dylib (authored by mgorny).
Herald added a project: Flang.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136606/new/

https://reviews.llvm.org/D136606

Files:
  flang/lib/Frontend/CMakeLists.txt
  flang/lib/FrontendTool/CMakeLists.txt


Index: flang/lib/FrontendTool/CMakeLists.txt
===================================================================
--- flang/lib/FrontendTool/CMakeLists.txt
+++ flang/lib/FrontendTool/CMakeLists.txt
@@ -5,15 +5,24 @@
   # This makes sure that the MLIR dependencies of flangFrontend (which are
   # transitively required here) are generated before this target is build.
   flangFrontend
-  clangBasic
 
   LINK_LIBS
   flangFrontend
-  clangBasic
-  clangDriver
   MLIRPass
 
   LINK_COMPONENTS
   Option
   Support
 )
+
+if(CLANG_LINK_CLANG_DYLIB)
+  add_dependencies(flangFrontend clang-cpp)
+else()
+  add_dependencies(flangFrontendTool clangBasic)
+endif()
+
+clang_target_link_libraries(flangFrontendTool
+  PRIVATE
+  clangBasic
+  clangDriver
+)
Index: flang/lib/Frontend/CMakeLists.txt
===================================================================
--- flang/lib/Frontend/CMakeLists.txt
+++ flang/lib/Frontend/CMakeLists.txt
@@ -12,7 +12,6 @@
   TextDiagnostic.cpp
 
   DEPENDS
-  clangBasic
   FIRBuilder
   FIRDialect
   FIRSupport
@@ -27,8 +26,6 @@
   FortranEvaluate
   FortranCommon
   FortranLower
-  clangBasic
-  clangDriver
   FIRDialect
   FIRSupport
   FIRBuilder
@@ -50,3 +47,15 @@
   FrontendOpenACC
   FrontendOpenMP
 )
+
+if(CLANG_LINK_CLANG_DYLIB)
+  add_dependencies(flangFrontend clang-cpp)
+else()
+  add_dependencies(flangFrontend clangBasic)
+endif()
+
+clang_target_link_libraries(flangFrontend
+  PRIVATE
+  clangBasic
+  clangDriver
+)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136606.471426.patch
Type: text/x-patch
Size: 1470 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20221028/e8c504ad/attachment-0001.bin>


More information about the flang-commits mailing list