CMake: Don't include tools, unittets, or examples as available targets
[oota-llvm.git] / unittests / CMakeLists.txt
1 function(add_llvm_unittest test_name)
2   if (CMAKE_BUILD_TYPE)
3     set(CMAKE_RUNTIME_OUTPUT_DIRECTORY
4       ${LLVM_BINARY_DIR}/unittests/${test_name}/${CMAKE_BUILD_TYPE})
5   else()
6     set(CMAKE_RUNTIME_OUTPUT_DIRECTORY
7       ${LLVM_BINARY_DIR}/unittests/${test_name})
8   endif()
9   if( NOT LLVM_BUILD_TESTS )
10     set(EXCLUDE_FROM_ALL ON)
11   endif()
12   if (LLVM_INCLUDE_TESTS OR LLVM_BUILD_TESTS)
13     add_llvm_executable(${test_name}Tests ${ARGN})
14   endif()
15 endfunction()
16
17 include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
18
19 set(LLVM_LINK_COMPONENTS
20   jit
21   interpreter
22   nativecodegen
23   BitWriter
24   BitReader
25   AsmParser
26   Core
27   System
28   Support
29   )
30
31 set(LLVM_USED_LIBS
32   gtest
33   gtest_main
34   )
35
36 add_llvm_unittest(ADT
37   ADT/APFloatTest.cpp
38   ADT/APIntTest.cpp
39   ADT/BitVectorTest.cpp
40   ADT/DAGDeltaAlgorithmTest.cpp
41   ADT/DeltaAlgorithmTest.cpp
42   ADT/DenseMapTest.cpp
43   ADT/DenseSetTest.cpp
44   ADT/ilistTest.cpp
45   ADT/ImmutableSetTest.cpp
46   ADT/SmallBitVectorTest.cpp
47   ADT/SmallStringTest.cpp
48   ADT/SmallVectorTest.cpp
49   ADT/SparseBitVectorTest.cpp
50   ADT/StringMapTest.cpp
51   ADT/StringRefTest.cpp
52   ADT/TripleTest.cpp
53   ADT/TwineTest.cpp
54   ADT/ValueMapTest.cpp
55   )
56
57 add_llvm_unittest(Analysis
58   Analysis/ScalarEvolutionTest.cpp
59   )
60
61 add_llvm_unittest(ExecutionEngine
62   ExecutionEngine/ExecutionEngineTest.cpp
63   )
64
65 add_llvm_unittest(JIT
66   ExecutionEngine/JIT/JITEventListenerTest.cpp
67   ExecutionEngine/JIT/JITMemoryManagerTest.cpp
68   ExecutionEngine/JIT/JITTest.cpp
69   ExecutionEngine/JIT/MultiJITTest.cpp
70   )
71
72 add_llvm_unittest(Support
73   Support/AllocatorTest.cpp
74   Support/Casting.cpp
75   Support/CommandLineTest.cpp
76   Support/ConstantRangeTest.cpp
77   Support/LeakDetectorTest.cpp
78   Support/MathExtrasTest.cpp
79   Support/raw_ostream_test.cpp
80   Support/RegexTest.cpp
81   Support/System.cpp
82   Support/TypeBuilderTest.cpp
83   Support/ValueHandleTest.cpp
84   )
85
86 add_llvm_unittest(Transforms
87   Transforms/Utils/Cloning.cpp
88   )
89
90 add_llvm_unittest(VMCore
91   VMCore/ConstantsTest.cpp
92   VMCore/DerivedTypesTest.cpp
93   VMCore/InstructionsTest.cpp
94   VMCore/MetadataTest.cpp
95   VMCore/PassManagerTest.cpp
96   VMCore/VerifierTest.cpp
97   )