[flang-commits] [flang] 042382c - [flang] Fix building against clang dylib
Michał Górny via flang-commits
flang-commits at lists.llvm.org
Fri Oct 28 00:40:41 PDT 2022
Author: Michał Górny
Date: 2022-10-28T09:40:34+02:00
New Revision: 042382cbc42b447e9771a66e81ab89c54aa7ea2a
URL: https://github.com/llvm/llvm-project/commit/042382cbc42b447e9771a66e81ab89c54aa7ea2a
DIFF: https://github.com/llvm/llvm-project/commit/042382cbc42b447e9771a66e81ab89c54aa7ea2a.diff
LOG: [flang] Fix building against clang dylib
Differential Revision: https://reviews.llvm.org/D136606
Added:
Modified:
flang/lib/Frontend/CMakeLists.txt
flang/lib/FrontendTool/CMakeLists.txt
Removed:
################################################################################
diff --git a/flang/lib/Frontend/CMakeLists.txt b/flang/lib/Frontend/CMakeLists.txt
index fbe3024479806..45fc97867e18c 100644
--- a/flang/lib/Frontend/CMakeLists.txt
+++ b/flang/lib/Frontend/CMakeLists.txt
@@ -12,7 +12,6 @@ add_flang_library(flangFrontend
TextDiagnostic.cpp
DEPENDS
- clangBasic
FIRBuilder
FIRDialect
FIRSupport
@@ -27,8 +26,6 @@ add_flang_library(flangFrontend
FortranEvaluate
FortranCommon
FortranLower
- clangBasic
- clangDriver
FIRDialect
FIRSupport
FIRBuilder
@@ -50,3 +47,15 @@ add_flang_library(flangFrontend
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
+)
diff --git a/flang/lib/FrontendTool/CMakeLists.txt b/flang/lib/FrontendTool/CMakeLists.txt
index 0753313d73427..59e4bd5d35736 100644
--- a/flang/lib/FrontendTool/CMakeLists.txt
+++ b/flang/lib/FrontendTool/CMakeLists.txt
@@ -5,15 +5,24 @@ add_flang_library(flangFrontendTool
# 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
+)
More information about the flang-commits
mailing list