[flang-commits] [flang] 50df5f2 - [flang] Fix build with BUILD_SHARED_LIBS=ON and FLANG_BUILD_NEW_DRIVER=ON
via flang-commits
flang-commits at lists.llvm.org
Thu Oct 15 04:04:19 PDT 2020
Author: Serge Guelton
Date: 2020-10-15T13:03:55+02:00
New Revision: 50df5f24dc333e912f6eb8500ef84e648d43af93
URL: https://github.com/llvm/llvm-project/commit/50df5f24dc333e912f6eb8500ef84e648d43af93
DIFF: https://github.com/llvm/llvm-project/commit/50df5f24dc333e912f6eb8500ef84e648d43af93.diff
LOG: [flang] Fix build with BUILD_SHARED_LIBS=ON and FLANG_BUILD_NEW_DRIVER=ON
As usual, it's difficult to handle all different configuration in the first row,
but this one has been extensively tested
Differential Revision: https://reviews.llvm.org/D89452
Added:
Modified:
flang/lib/Evaluate/CMakeLists.txt
flang/unittests/Evaluate/CMakeLists.txt
flang/unittests/Frontend/CMakeLists.txt
flang/unittests/Runtime/CMakeLists.txt
Removed:
################################################################################
diff --git a/flang/lib/Evaluate/CMakeLists.txt b/flang/lib/Evaluate/CMakeLists.txt
index 2a60dd7b85b4..a2fdc10896b4 100644
--- a/flang/lib/Evaluate/CMakeLists.txt
+++ b/flang/lib/Evaluate/CMakeLists.txt
@@ -44,6 +44,9 @@ add_flang_library(FortranEvaluate
FortranParser
${LIBPGMATH}
+ LINK_COMPONENTS
+ Support
+
DEPENDS
acc_gen
omp_gen
diff --git a/flang/unittests/Evaluate/CMakeLists.txt b/flang/unittests/Evaluate/CMakeLists.txt
index f9e522727ae4..ffd821ac65eb 100644
--- a/flang/unittests/Evaluate/CMakeLists.txt
+++ b/flang/unittests/Evaluate/CMakeLists.txt
@@ -3,13 +3,13 @@ add_library(FortranEvaluateTesting
testing.cpp
fp-testing.cpp
)
- if (LLVM_LINK_LLVM_DYLIB)
- set(llvm_libs LLVM)
- else()
- llvm_map_components_to_libnames(llvm_libs Support)
- endif()
- target_link_libraries(FortranEvaluateTesting
- ${llvm_libs})
+if (LLVM_LINK_LLVM_DYLIB)
+ set(llvm_libs LLVM)
+else()
+ llvm_map_components_to_libnames(llvm_libs Support)
+endif()
+target_link_libraries(FortranEvaluateTesting
+ ${llvm_libs})
add_flang_nongtest_unittest(leading-zero-bit-count
FortranEvaluateTesting
diff --git a/flang/unittests/Frontend/CMakeLists.txt b/flang/unittests/Frontend/CMakeLists.txt
index 54853a59adfe..fdccd68fb0ea 100644
--- a/flang/unittests/Frontend/CMakeLists.txt
+++ b/flang/unittests/Frontend/CMakeLists.txt
@@ -4,7 +4,6 @@ add_flang_unittest(FlangFrontendTests
target_link_libraries(FlangFrontendTests
PRIVATE
- LLVMSupport
clangBasic
clangFrontend
flangFrontend
diff --git a/flang/unittests/Runtime/CMakeLists.txt b/flang/unittests/Runtime/CMakeLists.txt
index 45dc65bd0fef..b9bfeab2d08a 100644
--- a/flang/unittests/Runtime/CMakeLists.txt
+++ b/flang/unittests/Runtime/CMakeLists.txt
@@ -8,8 +8,14 @@ add_library(RuntimeTesting
)
llvm_update_compile_flags(RuntimeTesting)
+if (LLVM_LINK_LLVM_DYLIB)
+ set(llvm_libs LLVM)
+else()
+ llvm_map_components_to_libnames(llvm_libs Support)
+endif()
target_link_libraries(RuntimeTesting
FortranRuntime
+ ${llvm_libs}
)
add_flang_nongtest_unittest(format
More information about the flang-commits
mailing list