[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
This commit is contained in:
Serge Guelton 2020-10-15 04:46:02 -04:00 committed by serge-sans-paille
parent ead2aa7098
commit 50df5f24dc
4 changed files with 16 additions and 8 deletions

View File

@ -44,6 +44,9 @@ add_flang_library(FortranEvaluate
FortranParser
${LIBPGMATH}
LINK_COMPONENTS
Support
DEPENDS
acc_gen
omp_gen

View File

@ -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

View File

@ -4,7 +4,6 @@ add_flang_unittest(FlangFrontendTests
target_link_libraries(FlangFrontendTests
PRIVATE
LLVMSupport
clangBasic
clangFrontend
flangFrontend

View File

@ -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