Fix typo in i386 build
[dyninst.git] / dyninstAPI / CMakeLists.txt
1 # CMake configuration for dyninstAPI directory
2
3 include_directories (
4     ${PROJECT_SOURCE_DIR}/dyninstAPI/src
5   )
6
7 set (SRC_LIST
8      src/BPatch.C 
9      src/BPatch_image.C 
10      src/BPatch_function.C 
11      src/BPatch_snippet.C 
12      src/BPatch_thread.C 
13      src/BPatch_process.C 
14      src/BPatch_type.C 
15      src/BPatch_module.C 
16      src/BPatch_object.C 
17      src/BPatch_point.C 
18      src/BPatch_collections.C 
19      src/BPatch_sourceBlock.C 
20      src/BPatch_basicBlock.C 
21      src/BPatch_basicBlockLoop.C 
22      src/BPatch_edge.C 
23      src/BPatch_loopTreeNode.C 
24      src/BPatch_flowGraph.C 
25      src/BPatch_frame.C 
26      src/BPatch_parRegion.C 
27      src/BPatch_statement.C 
28      src/BPatch_addressSpace.C 
29      src/BPatch_binaryEdit.C 
30      src/BPatch_memoryAccess.C 
31      src/dummy.C 
32      src/debug.C 
33      src/ast.C 
34      src/registerSpace.C 
35      src/codegen.C 
36      src/inst.C 
37      src/instPoint.C 
38      src/baseTramp.C 
39      src/addressSpace.C 
40      src/binaryEdit.C 
41      src/infHeap.C 
42      src/frame.C 
43      src/codeRange.C 
44      src/image.C 
45      src/dominator.C 
46      src/parse-cfg.C 
47      src/mapped_object.C 
48      src/mapped_module.C 
49      src/function.C 
50      src/block.C 
51      src/edge.C 
52      src/variable.C 
53      src/util.C 
54      src/BPatch_instruction.C 
55      src/parRegion.C 
56      src/Parsing.C 
57      src/Parsing-arch.C 
58      src/hybridInstrumentation.C 
59      src/hybridOverwrites.C 
60      src/hybridCallbacks.C 
61      src/dynProcess.C 
62      src/dynThread.C 
63      src/pcEventHandler.C 
64      src/pcEventMuxer.C 
65      src/syscallNotification.C 
66      src/Relocation/CodeMover.C 
67      src/Relocation/CFG/RelocGraph.C 
68      src/Relocation/CFG/RelocBlock.C 
69      src/Relocation/CFG/RelocEdge.C 
70      src/Relocation/CFG/RelocTarget.C 
71      src/Relocation/Springboard.C 
72      src/Relocation/Widgets/ASTWidget.C 
73      src/Relocation/Widgets/CFWidget.C 
74      src/Relocation/Widgets/CallbackWidget.C 
75      src/Relocation/Widgets/InsnWidget.C 
76      src/Relocation/Widgets/InstWidget.C 
77      src/Relocation/Widgets/PCWidget.C 
78      src/Relocation/Widgets/RelDataWidget.C 
79      src/Relocation/Transformers/Transformer.C 
80      src/Relocation/Transformers/Instrumenter.C 
81      src/Relocation/Transformers/Modification.C 
82      src/Relocation/Transformers/Movement-adhoc.C 
83      src/Relocation/Transformers/Movement-analysis.C 
84      src/Relocation/CodeTracker.C 
85      src/Relocation/CodeBuffer.C 
86      src/Relocation/patchapi_debug.C 
87      src/Relocation/DynObject.C 
88      src/Relocation/DynAddrSpace.C 
89      src/Relocation/DynPointMaker.C 
90      src/Relocation/DynCFGMaker.C 
91      src/Relocation/DynInstrumenter.C 
92      src/Patching.C
93      src/frameChecker.C
94      src/BPatch_memoryAccessAdapter.C
95 )
96
97 # This is just .. messy. Sorry.
98
99 if (PLATFORM MATCHES i386)
100 set (SRC_LIST ${SRC_LIST} src/cpuid-x86.S)
101 endif ()
102
103 if (PLATFORM MATCHES i386 OR PLATFORM MATCHES amd64 OR PLATFORM MATCHES x86_64)
104 set (SRC_LIST ${SRC_LIST}
105      src/RegisterConversion-x86.C
106      src/Relocation/Widgets/CFWidget-x86.C
107      src/inst-x86.C
108      src/emit-x86.C
109      src/codegen-x86.C
110      src/stackwalk-x86.C
111      src/dynProcess-x86.C
112      src/parse-x86.C 
113      src/IAPI_to_AST.C 
114 )
115 elseif (PLATFORM MATCHES ppc)
116 set (SRC_LIST ${SRC_LIST}
117      src/inst-power.C 
118      src/codegen-power.C 
119      src/parse-power.C 
120      src/RegisterConversion-ppc.C 
121      src/stackwalk-ppc.C
122      src/Relocation/Widgets/CFWidget-ppc.C
123 )
124 endif ()
125
126 if (PLATFORM MATCHES freebsd)
127 set (SRC_LIST ${SRC_LIST} 
128      src/freebsd.C
129      src/unix.C
130      src/freebsd-x86.C
131      src/syscall-freebsd.C
132 )
133 elseif (PLATFORM MATCHES linux OR PLATFORM MATCHES bgq)
134 set (SRC_LIST ${SRC_LIST}
135      src/linux.C
136      src/inst-linux.C
137      src/unix.C
138      src/syscall-linux.C
139 )
140   if (PLATFORM MATCHES i386 OR PLATFORM MATCHES x86_64)
141     set (SRC_LIST ${SRC_LIST} src/linux-x86.C)
142   elseif (PLATFORM MATCHES ppc)
143     set (SRC_LIST ${SRC_LIST} src/linux-power.C)
144   endif()
145 endif()
146
147 add_library (dyninstAPI ${SRC_LIST})
148
149 target_link_libraries (dyninstAPI stackwalker)
150 target_link_libraries (dyninstAPI pcontrol)
151 target_link_libraries (dyninstAPI patchAPI)
152 target_link_libraries (dyninstAPI parseAPI)
153 target_link_libraries (dyninstAPI symtabAPI)
154
155 if (UNIX)
156 target_link_libraries (dyninstAPI dynElf)
157 target_link_libraries (dyninstAPI dynDwarf)
158 target_link_libraries (dyninstAPI ${LIBELF_LIBRARIES})
159 target_link_libraries (dyninstAPI ${LIBDWARF_LIBRARIES})
160 target_link_libraries (dyninstAPI pthread)
161 endif()
162
163 INSTALL (DIRECTORY h/ DESTINATION include FILES_MATCHING PATTERN "*.h")
164 INSTALL (TARGETS dyninstAPI
165         LIBRARY DESTINATION lib)