GCC 4.8 build fixes: ensure all extern template declarations are in fact extern'ed...
[dyninst.git] / parseAPI / CMakeLists.txt
1 # CMake configuration for parseAPI directory
2
3 include_directories (
4     ${PROJECT_SOURCE_DIR}/parseAPI/src
5   )
6
7
8 set (SRC_LIST
9         src/ParserDetails.C 
10         src/Parser.C 
11         src/CFGFactory.C 
12         src/Function.C 
13         src/Block.C 
14         src/CodeObject.C 
15         src/debug_parse.C 
16         src/CodeSource.C 
17         src/ParseData.C
18         src/InstructionAdapter.C
19         src/Parser-speculative.C
20         src/ParseCallback.C 
21         src/IA_IAPI.C
22         src/IA_x86Details.C 
23         src/IA_powerDetails.C 
24         src/IA_aarch64Details.C 
25         src/IA_platformDetailsFactory.C 
26         src/CFGModifier.C
27         src/StackTamperVisitor.C
28         src/JumpTablePred.C
29         src/BoundFactCalculator.C
30         src/BoundFactData.C
31         src/IndirectAnalyzer.C
32         src/IndirectASTVisitor.C
33         src/ThunkData.C
34         ../dataflowAPI/src/ABI.C 
35         src/dominator.C
36         src/LoopAnalyzer.C
37         src/Loop.C
38         src/LoopTreeNode.C
39         src/IdiomModelDesc.C
40         src/ProbabilisticParser.C
41         ../dataflowAPI/src/ABI.C 
42         ../dataflowAPI/src/Absloc.C 
43         ../dataflowAPI/src/AbslocInterface.C 
44         ../dataflowAPI/src/convertOpcodes.C 
45         ../dataflowAPI/src/debug_dataflow.C 
46         ../dataflowAPI/src/ExpressionConversionVisitor.C 
47         ../dataflowAPI/src/InstructionCache.C 
48         ../dataflowAPI/src/liveness.C 
49         ../dataflowAPI/src/RegisterMap.C 
50         ../dataflowAPI/src/RoseImpl.C 
51         ../dataflowAPI/src/RoseInsnFactory.C 
52         ../dataflowAPI/src/slicing.C 
53         ../dataflowAPI/src/stackanalysis.C 
54         ../dataflowAPI/src/SymbolicExpansion.C 
55         ../dataflowAPI/src/SymEval.C 
56         ../dataflowAPI/src/SymEvalPolicy.C 
57         ../dataflowAPI/src/templates.C 
58         ../dataflowAPI/src/Visitors.C 
59     )
60
61 if (LIGHTWEIGHT_SYMTAB)
62 set (SRC_LIST ${SRC_LIST}
63     src/SymLiteCodeSource.C
64 )
65 else()
66 set (SRC_LIST ${SRC_LIST}
67     src/SymtabCodeSource.C
68 )
69 endif()
70
71 if (PLATFORM MATCHES amd64 OR PLATFORM MATCHES i386 OR PLATFORM
72 MATCHES x86_64)
73 set (SRC_LIST ${SRC_LIST}
74      src/InstructionSource-x86.C
75      src/IA_x86.C
76 )
77 elseif (PLATFORM MATCHES ppc)
78 set (SRC_LIST ${SRC_LIST}
79      src/InstructionSource-power.C
80      src/IA_power.C
81 )
82 elseif (PLATFORM MATCHES aarch64)
83 set (SRC_LIST ${SRC_LIST}
84      src/InstructionSource-aarch64.C
85      src/IA_aarch64.C
86 )
87 endif()
88
89 if (ENABLE_PARSE_API_GRAPHS)
90 set (SRC_LIST ${SRC_LIST}
91      src/GraphAdapter.C
92     )
93 endif()
94
95 SET_SOURCE_FILES_PROPERTIES(${SRC_LIST} PROPERTIES LANGUAGE CXX)
96
97 ADD_DEFINITIONS(-DPARSER_LIB)
98 ADD_DEFINITIONS(-DDATAFLOW_LIB)
99
100 dyninst_library(parseAPI common instructionAPI ${SYMREADER})
101
102 if (UNIX)
103         # Boost auto-links on Windows; don't double-link
104         target_link_private_libraries(parseAPI ${Boost_LIBRARIES})
105 endif()
106
107 FILE (GLOB headers "h/*.h")
108 FILE (GLOB dataflowheaders "../dataflowAPI/h/*.h")
109 set_target_properties (parseAPI PROPERTIES PUBLIC_HEADER "${headers};${dataflowheaders}")
110 if(${ENABLE_STATIC_LIBS})
111   set_target_properties (parseAPI_static PROPERTIES PUBLIC_HEADER "${headers};${dataflowheaders}")
112 endif()
113
114 install (TARGETS parseAPI
115     RUNTIME DESTINATION ${INSTALL_LIB_DIR}
116     LIBRARY DESTINATION ${INSTALL_LIB_DIR}
117     ARCHIVE DESTINATION ${INSTALL_LIB_DIR}
118     PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDE_DIR})