llvm/unittests: Simplify LINK_COMPONENTS.
[oota-llvm.git] / unittests / ExecutionEngine / JIT / CMakeLists.txt
1 set(LLVM_LINK_COMPONENTS
2   asmparser
3   bitreader
4   bitwriter
5   jit
6   nativecodegen
7   )
8
9 # HACK: Declare a couple of source files as optionally compiled to satisfy the
10 # missing-file-checker in LLVM's weird CMake build.
11 set(LLVM_OPTIONAL_SOURCES
12   IntelJITEventListenerTest.cpp
13   OProfileJITEventListenerTest.cpp
14   )
15
16 if( LLVM_USE_INTEL_JITEVENTS )
17   include_directories( ${LLVM_INTEL_JITEVENTS_INCDIR} )
18   link_directories( ${LLVM_INTEL_JITEVENTS_LIBDIR} )
19   set(ProfileTestSources
20     IntelJITEventListenerTest.cpp
21     )
22   set(LLVM_LINK_COMPONENTS
23     ${LLVM_LINK_COMPONENTS}
24     IntelJITEvents
25     ) 
26 endif( LLVM_USE_INTEL_JITEVENTS )
27
28 if( LLVM_USE_OPROFILE )
29   set(ProfileTestSources
30     ${ProfileTestSources}
31     OProfileJITEventListenerTest.cpp
32     )
33   set(LLVM_LINK_COMPONENTS
34     ${LLVM_LINK_COMPONENTS}
35     OProfileJIT
36     )
37 endif( LLVM_USE_OPROFILE )
38
39 set(JITTestsSources
40   JITEventListenerTest.cpp
41   JITMemoryManagerTest.cpp
42   JITTest.cpp
43   MultiJITTest.cpp
44   ${ProfileTestSources}
45   )
46
47 if(MSVC)
48   list(APPEND JITTestsSources JITTests.def)
49 endif()
50
51 add_llvm_unittest(JITTests
52   ${JITTestsSources}
53   )
54
55 if(MINGW OR CYGWIN)
56   set_property(TARGET JITTests PROPERTY LINK_FLAGS -Wl,--export-all-symbols)
57 endif()