Skip to content

Commit 50df5f2

Browse files
author
Serge Guelton
committed
[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
1 parent ead2aa7 commit 50df5f2

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

flang/lib/Evaluate/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ add_flang_library(FortranEvaluate
4444
FortranParser
4545
${LIBPGMATH}
4646

47+
LINK_COMPONENTS
48+
Support
49+
4750
DEPENDS
4851
acc_gen
4952
omp_gen

flang/unittests/Evaluate/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ add_library(FortranEvaluateTesting
33
testing.cpp
44
fp-testing.cpp
55
)
6-
if (LLVM_LINK_LLVM_DYLIB)
7-
set(llvm_libs LLVM)
8-
else()
9-
llvm_map_components_to_libnames(llvm_libs Support)
10-
endif()
11-
target_link_libraries(FortranEvaluateTesting
12-
${llvm_libs})
6+
if (LLVM_LINK_LLVM_DYLIB)
7+
set(llvm_libs LLVM)
8+
else()
9+
llvm_map_components_to_libnames(llvm_libs Support)
10+
endif()
11+
target_link_libraries(FortranEvaluateTesting
12+
${llvm_libs})
1313

1414
add_flang_nongtest_unittest(leading-zero-bit-count
1515
FortranEvaluateTesting

flang/unittests/Frontend/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ add_flang_unittest(FlangFrontendTests
44

55
target_link_libraries(FlangFrontendTests
66
PRIVATE
7-
LLVMSupport
87
clangBasic
98
clangFrontend
109
flangFrontend

flang/unittests/Runtime/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,14 @@ add_library(RuntimeTesting
88
)
99
llvm_update_compile_flags(RuntimeTesting)
1010

11+
if (LLVM_LINK_LLVM_DYLIB)
12+
set(llvm_libs LLVM)
13+
else()
14+
llvm_map_components_to_libnames(llvm_libs Support)
15+
endif()
1116
target_link_libraries(RuntimeTesting
1217
FortranRuntime
18+
${llvm_libs}
1319
)
1420

1521
add_flang_nongtest_unittest(format

0 commit comments

Comments
 (0)