Skip to content

Commit 11a9773

Browse files
committed
Move Testing library CMake code to lib/Testing
1 parent 6582419 commit 11a9773

File tree

3 files changed

+35
-24
lines changed

3 files changed

+35
-24
lines changed

flang/lib/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ add_subdirectory(Frontend)
88
add_subdirectory(FrontendTool)
99

1010
add_subdirectory(Optimizer)
11+
12+
if (FLANG_INCLUDE_TESTS)
13+
add_subdirectory(Testing)
14+
endif ()

flang/lib/Testing/CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#===-- lib/Testing/CMakeLists.txt ------------------------------------------===#
2+
#
3+
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
# See https://llvm.org/LICENSE.txt for license information.
5+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
#
7+
#===------------------------------------------------------------------------===#
8+
9+
add_library(NonGTestTesting EXCLUDE_FROM_ALL
10+
testing.cpp
11+
fp-testing.cpp
12+
)
13+
set_target_properties(NonGTestTesting PROPERTIES FOLDER "Flang/Tests")
14+
15+
if (LLVM_LINK_LLVM_DYLIB)
16+
set(llvm_libs LLVM)
17+
else()
18+
llvm_map_components_to_libnames(llvm_libs Support)
19+
endif()
20+
target_link_libraries(NonGTestTesting ${llvm_libs})
Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,34 @@
11
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
2-
add_library(FortranEvaluateTesting
3-
${FLANG_SOURCE_DIR}/lib/Testing/testing.cpp
4-
${FLANG_SOURCE_DIR}/lib/Testing/fp-testing.cpp
5-
)
6-
set_target_properties(FortranEvaluateTesting PROPERTIES FOLDER "Flang/Tests")
7-
if (LLVM_LINK_LLVM_DYLIB)
8-
set(llvm_libs LLVM)
9-
else()
10-
llvm_map_components_to_libnames(llvm_libs Support)
11-
endif()
12-
13-
target_link_libraries(FortranEvaluateTesting
14-
${llvm_libs})
152

163
add_flang_nongtest_unittest(leading-zero-bit-count
17-
FortranEvaluateTesting
4+
NonGTestTesting
185
)
196

207
add_flang_nongtest_unittest(bit-population-count
21-
FortranEvaluateTesting
8+
NonGTestTesting
229
)
2310

2411
add_flang_nongtest_unittest(uint128
25-
FortranEvaluateTesting
12+
NonGTestTesting
2613
)
2714

2815
add_flang_nongtest_unittest(expression
2916
FortranSupport
30-
FortranEvaluateTesting
17+
NonGTestTesting
3118
FortranEvaluate
3219
FortranSemantics
3320
FortranParser
3421
)
3522

3623
add_flang_nongtest_unittest(integer
37-
FortranEvaluateTesting
24+
NonGTestTesting
3825
FortranEvaluate
3926
FortranSemantics
4027
)
4128

4229
add_flang_nongtest_unittest(intrinsics
4330
FortranSupport
44-
FortranEvaluateTesting
31+
NonGTestTesting
4532
FortranEvaluate
4633
FortranDecimal
4734
FortranSemantics
@@ -50,7 +37,7 @@ add_flang_nongtest_unittest(intrinsics
5037
)
5138

5239
add_flang_nongtest_unittest(logical
53-
FortranEvaluateTesting
40+
NonGTestTesting
5441
FortranEvaluate
5542
FortranSemantics
5643
)
@@ -62,30 +49,30 @@ add_flang_nongtest_unittest(logical
6249
set(LLVM_REQUIRES_EH ON)
6350
set(LLVM_REQUIRES_RTTI ON)
6451
add_flang_nongtest_unittest(real
65-
FortranEvaluateTesting
52+
NonGTestTesting
6653
FortranEvaluate
6754
FortranDecimal
6855
FortranSemantics
6956
)
7057
llvm_update_compile_flags(real.test)
7158

7259
add_flang_nongtest_unittest(reshape
73-
FortranEvaluateTesting
60+
NonGTestTesting
7461
FortranSemantics
7562
FortranEvaluate
7663
FortranRuntime
7764
)
7865

7966
add_flang_nongtest_unittest(ISO-Fortran-binding
80-
FortranEvaluateTesting
67+
NonGTestTesting
8168
FortranEvaluate
8269
FortranSemantics
8370
FortranRuntime
8471
)
8572

8673
add_flang_nongtest_unittest(folding
8774
FortranSupport
88-
FortranEvaluateTesting
75+
NonGTestTesting
8976
FortranEvaluate
9077
FortranSemantics
9178
)

0 commit comments

Comments
 (0)