File tree Expand file tree Collapse file tree 7 files changed +41
-41
lines changed Expand file tree Collapse file tree 7 files changed +41
-41
lines changed Original file line number Diff line number Diff line change @@ -229,9 +229,8 @@ if(LINK_WITH_FIR)
229
229
endif ()
230
230
# Always build tco tool
231
231
set (LLVM_BUILD_TOOLS ON )
232
- message (STATUS "Linking driver with FIR and LLVM" )
233
- llvm_map_components_to_libnames (LLVM_COMMON_LIBS support )
234
- message (STATUS "LLVM libraries: ${LLVM_COMMON_LIBS} " )
232
+ set (LLVM_COMMON_COMPONENTS Support )
233
+ message (STATUS "Linking driver with FIR and LLVM, using LLVM components: ${LLVM_COMMON_COMPONENTS} " )
235
234
endif ()
236
235
237
236
# Add Flang-centric modules to cmake path.
Original file line number Diff line number Diff line change @@ -61,7 +61,6 @@ macro(add_flang_library name)
61
61
llvm_add_library (${name} ${LIBTYPE} ${ARG_UNPARSED_ARGUMENTS} ${srcs} )
62
62
63
63
if (TARGET ${name} )
64
- target_link_libraries (${name} INTERFACE ${LLVM_COMMON_LIBS} )
65
64
66
65
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libflang" )
67
66
set (export_to_flangtargets )
Original file line number Diff line number Diff line change @@ -7,20 +7,23 @@ link_directories(${LLVM_LIBRARY_DIR})
7
7
add_flang_tool (flang-new
8
8
driver.cpp
9
9
fc1_main.cpp
10
+
11
+ LINK_COMPONENTS
12
+
13
+ ${LLVM_COMMON_COMPONENTS}
14
+ Support
15
+ Target
16
+ Option
10
17
)
11
18
12
19
# Link against LLVM and Clang libraries
13
20
target_link_libraries (flang-new
14
21
PRIVATE
15
- ${LLVM_COMMON_LIBS}
16
22
flangFrontend
17
23
flangFrontendTool
18
24
clangDriver
19
25
clangBasic
20
26
clangFrontend
21
- LLVMSupport
22
- LLVMTarget
23
- LLVMOption
24
27
)
25
28
26
29
install (TARGETS flang-new DESTINATION bin )
Original file line number Diff line number Diff line change @@ -10,11 +10,30 @@ if (CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG)
10
10
endif ()
11
11
12
12
function (add_flang_nongtest_unittest test_name )
13
- add_executable (${test_name} .test ${test_name} .cpp )
13
+ cmake_parse_arguments (ARG
14
+ "SLOW_TEST"
15
+ ""
16
+ ""
17
+ ${ARGN} )
14
18
15
- target_link_libraries (${test_name} .test ${ARGN} )
19
+ if (ARG_SLOW_TEST )
20
+ set (suffix .slow )
21
+ else ()
22
+ set (suffix .test )
23
+ endif ()
16
24
17
- add_dependencies (FlangUnitTests ${test_name} .test )
25
+ add_executable (${test_name}${suffix} ${test_name} .cpp )
26
+
27
+ if (LLVM_LINK_LLVM_DYLIB AND NOT ARG_DISABLE_LLVM_LINK_LLVM_DYLIB )
28
+ set (llvm_libs LLVM )
29
+ else ()
30
+ llvm_map_components_to_libnames (llvm_libs Support )
31
+ endif ()
32
+ target_link_libraries (${test_name}${suffix} ${llvm_libs} ${ARG_UNPARSED_ARGUMENTS} )
33
+
34
+ if (NOT ARG_SLOW_TEST )
35
+ add_dependencies (FlangUnitTests ${test_name}${suffix} )
36
+ endif ()
18
37
endfunction ()
19
38
20
39
add_subdirectory (Optimizer )
Original file line number Diff line number Diff line change 1
1
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )
2
2
add_flang_nongtest_unittest (quick-sanity-test
3
3
FortranDecimal
4
- LLVMSupport
5
4
)
6
5
7
- # This test is not run by default as it takes a long time to execute
8
- add_executable (thorough-test
9
- thorough-test.cpp
10
- )
11
-
12
- target_link_libraries (thorough-test
6
+ # This test is not run by default as it takes a long time to execute.
7
+ add_flang_nongtest_unittest (thorough-test
8
+ SLOW_TEST
13
9
FortranDecimal
14
- LLVMSupport
15
10
)
Original file line number Diff line number Diff line change @@ -3,24 +3,24 @@ add_library(FortranEvaluateTesting
3
3
testing.cpp
4
4
fp-testing.cpp
5
5
)
6
-
7
- target_link_libraries (FortranEvaluateTesting
8
- LLVMSupport
9
- )
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} )
10
13
11
14
add_flang_nongtest_unittest (leading-zero-bit-count
12
15
FortranEvaluateTesting
13
- LLVMSupport
14
16
)
15
17
16
18
add_flang_nongtest_unittest (bit-population-count
17
19
FortranEvaluateTesting
18
- LLVMSupport
19
20
)
20
21
21
22
add_flang_nongtest_unittest (uint128
22
23
FortranEvaluateTesting
23
- LLVMSupport
24
24
)
25
25
26
26
add_flang_nongtest_unittest (expression
@@ -29,14 +29,12 @@ add_flang_nongtest_unittest(expression
29
29
FortranEvaluate
30
30
FortranSemantics
31
31
FortranParser
32
- LLVMSupport
33
32
)
34
33
35
34
add_flang_nongtest_unittest (integer
36
35
FortranEvaluateTesting
37
36
FortranEvaluate
38
37
FortranSemantics
39
- LLVMSupport
40
38
)
41
39
42
40
add_flang_nongtest_unittest (intrinsics
@@ -47,14 +45,12 @@ add_flang_nongtest_unittest(intrinsics
47
45
FortranSemantics
48
46
FortranParser
49
47
FortranRuntime
50
- LLVMSupport
51
48
)
52
49
53
50
add_flang_nongtest_unittest (logical
54
51
FortranEvaluateTesting
55
52
FortranEvaluate
56
53
FortranSemantics
57
- LLVMSupport
58
54
)
59
55
60
56
# GCC -fno-exceptions breaks the fenv.h interfaces needed to capture
@@ -68,7 +64,6 @@ add_flang_nongtest_unittest(real
68
64
FortranEvaluate
69
65
FortranDecimal
70
66
FortranSemantics
71
- LLVMSupport
72
67
)
73
68
llvm_update_compile_flags (real.test )
74
69
@@ -77,21 +72,18 @@ add_flang_nongtest_unittest(reshape
77
72
FortranSemantics
78
73
FortranEvaluate
79
74
FortranRuntime
80
- LLVMSupport
81
75
)
82
76
83
77
add_flang_nongtest_unittest (ISO-Fortran-binding
84
78
FortranEvaluateTesting
85
79
FortranEvaluate
86
80
FortranSemantics
87
81
FortranRuntime
88
- LLVMSupport
89
82
)
90
83
91
84
add_flang_nongtest_unittest (folding
92
85
FortranCommon
93
86
FortranEvaluateTesting
94
87
FortranEvaluate
95
88
FortranSemantics
96
- LLVMSupport
97
89
)
Original file line number Diff line number Diff line change @@ -10,19 +10,16 @@ llvm_update_compile_flags(RuntimeTesting)
10
10
11
11
target_link_libraries (RuntimeTesting
12
12
FortranRuntime
13
- LLVMSupport
14
13
)
15
14
16
15
add_flang_nongtest_unittest (format
17
16
RuntimeTesting
18
17
FortranRuntime
19
- LLVMSupport
20
18
)
21
19
22
20
add_flang_nongtest_unittest (hello
23
21
RuntimeTesting
24
22
FortranRuntime
25
- LLVMSupport
26
23
)
27
24
28
25
# This test is not run by default as it requires input.
@@ -32,23 +29,19 @@ add_executable(external-hello-world
32
29
33
30
target_link_libraries (external-hello-world
34
31
FortranRuntime
35
- LLVMSupport
36
32
)
37
33
38
34
add_flang_nongtest_unittest (external-io
39
35
RuntimeTesting
40
36
FortranRuntime
41
- LLVMSupport
42
37
)
43
38
44
39
add_flang_nongtest_unittest (list -input
45
40
RuntimeTesting
46
41
FortranRuntime
47
- LLVMSupport
48
42
)
49
43
50
44
add_flang_nongtest_unittest (character
51
45
RuntimeTesting
52
46
FortranRuntime
53
- LLVMSupport
54
47
)
You can’t perform that action at this time.
0 commit comments