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

Michał Górny via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon Oct 24 07:54:34 PDT 2022


mgorny created this revision.
mgorny added reviewers: awarzynski, stellaraccident, mehdi_amini, tstellar, MaskRay.
Herald added a reviewer: sscalpone.
Herald added a subscriber: StephenFan.
Herald added a project: All.
mgorny requested review of this revision.

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,22 @@
   # 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(TARGET clangBasic)
+  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,13 @@
   FrontendOpenACC
   FrontendOpenMP
 )
+
+if(TARGET clangBasic)
+  add_dependencies(flangFrontend clangBasic)
+endif()
+
+clang_target_link_libraries(flangFrontend
+  PRIVATE
+  clangBasic
+  clangDriver
+)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136606.470153.patch
Type: text/x-patch
Size: 1354 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20221024/7ad96667/attachment.bin>


More information about the flang-commits mailing list