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