Skip to content

Commit

Permalink
[flang] Fix build with BUILD_SHARED_LIBS=ON and FLANG_BUILD_NEW_DRIVE…
Browse files Browse the repository at this point in the history
…R=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
  • Loading branch information
Serge Guelton committed Oct 15, 2020
1 parent ead2aa7 commit 50df5f2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
3 changes: 3 additions & 0 deletions flang/lib/Evaluate/CMakeLists.txt
Expand Up @@ -44,6 +44,9 @@ add_flang_library(FortranEvaluate
FortranParser
${LIBPGMATH}

LINK_COMPONENTS
Support

DEPENDS
acc_gen
omp_gen
Expand Down
14 changes: 7 additions & 7 deletions flang/unittests/Evaluate/CMakeLists.txt
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion flang/unittests/Frontend/CMakeLists.txt
Expand Up @@ -4,7 +4,6 @@ add_flang_unittest(FlangFrontendTests

target_link_libraries(FlangFrontendTests
PRIVATE
LLVMSupport
clangBasic
clangFrontend
flangFrontend
Expand Down
6 changes: 6 additions & 0 deletions flang/unittests/Runtime/CMakeLists.txt
Expand Up @@ -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
Expand Down

0 comments on commit 50df5f2

Please sign in to comment.