C++ cleanup (#610)
[dyninst.git] / parseAPI / CMakeLists.txt
1 # CMake configuration for parseAPI directory
2
3 include_directories (
4     ${PROJECT_SOURCE_DIR}/parseAPI/src
5   )
6
7 set (SRC_LIST
8         src/ParserDetails.C 
9         src/Parser.C 
10         src/CFGFactory.C 
11         src/Function.C 
12         src/Block.C 
13         src/CodeObject.C 
14         src/debug_parse.C 
15         src/CodeSource.C 
16         src/ParseData.C
17         src/InstructionAdapter.C
18         src/Parser-speculative.C
19         src/ParseCallback.C 
20         src/IA_IAPI.C
21         src/IA_x86.C
22         src/IA_power.C
23         src/IA_aarch64.C
24         src/CFGModifier.C
25         src/StackTamperVisitor.C
26         src/JumpTableFormatPred.C
27         src/JumpTableIndexPred.C
28         src/IndirectAnalyzer.C
29         src/IndirectASTVisitor.C
30         src/SymbolicExpression.C
31         src/BoundFactCalculator.C
32         src/BoundFactData.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     )
42
43 set(ROSE_SRC
44         ../dataflowAPI/src/ABI.C 
45         ../dataflowAPI/src/Absloc.C 
46         ../dataflowAPI/src/AbslocInterface.C 
47         ../dataflowAPI/src/convertOpcodes.C 
48         ../dataflowAPI/src/debug_dataflow.C 
49         ../dataflowAPI/src/ExpressionConversionVisitor.C 
50         ../dataflowAPI/src/InstructionCache.C 
51         ../dataflowAPI/src/liveness.C 
52         ../dataflowAPI/src/RegisterMap.C
53         ../dataflowAPI/src/RoseImpl.C
54         ../dataflowAPI/src/RoseInsnFactory.C
55         ../dataflowAPI/src/slicing.C
56         ../dataflowAPI/src/stackanalysis.C
57         ../dataflowAPI/src/SymbolicExpansion.C
58         ../dataflowAPI/src/SymEval.C
59         ../dataflowAPI/src/SymEvalPolicy.C
60         ../dataflowAPI/src/templates.C
61         ../dataflowAPI/src/Visitors.C
62         ../dataflowAPI/rose/ExtentMap.C
63         ../dataflowAPI/rose/rangemap.C
64         ../dataflowAPI/rose/util/Assert.C
65         ../dataflowAPI/rose/util/Message.C
66         ../dataflowAPI/rose/util/Sawyer.C
67         ../dataflowAPI/rose/util/Synchronization.C
68         ../dataflowAPI/rose/util/rose_getline.C
69         ../dataflowAPI/rose/util/SmallObject.C
70         ../dataflowAPI/rose/util/Stopwatch.C
71         ../dataflowAPI/rose/util/StringUtility.C
72         ../dataflowAPI/rose/util/Attribute.C
73         ../dataflowAPI/rose/util/Combinatorics.C
74         ../dataflowAPI/rose/util/LinearCongruentialGenerator.C
75         ../dataflowAPI/rose/semantics/BaseSemantics2.C
76         #../dataflowAPI/rose/semantics/ConcreteSemantics2.C
77         ../dataflowAPI/rose/semantics/DispatcherARM64.C
78         ../dataflowAPI/rose/semantics/DispatcherPowerpc.C
79         ../dataflowAPI/rose/semantics/RegisterParts.C
80         ../dataflowAPI/rose/semantics/Registers.C
81         #../dataflowAPI/rose/semantics/SMTSolver.C
82         ../dataflowAPI/rose/semantics/BinarySymbolicExpr.C
83         ../dataflowAPI/rose/semantics/RegisterStateGeneric.C
84         ../dataflowAPI/rose/semantics/SymEvalSemantics.C
85 )
86
87 # FIXME: Rose needs a bunch of warning cleanup
88 SET_SOURCE_FILES_PROPERTIES(${ROSE_SRC} PROPERTIES LANGUAGE CXX COMPILE_FLAGS -w)
89 set (SRC_LIST ${SRC_LIST}
90         ${ROSE_SRC}
91 )
92
93 if (LIGHTWEIGHT_SYMTAB)
94 set (SRC_LIST ${SRC_LIST}
95     src/SymLiteCodeSource.C
96 )
97 else()
98 set (SRC_LIST ${SRC_LIST}
99     src/SymtabCodeSource.C
100 )
101 endif()
102
103 if (ENABLE_PARSE_API_GRAPHS)
104 set (SRC_LIST ${SRC_LIST}
105      src/GraphAdapter.C
106     )
107 endif()
108
109
110 ADD_DEFINITIONS(-DPARSER_LIB)
111 ADD_DEFINITIONS(-DDATAFLOW_LIB)
112 if(WIN32)
113 ADD_DEFINITIONS(-DROSE_UTIL_EXPORTS)
114 ADD_DEFINITIONS(-DNOMINMAX)
115 endif()
116 dyninst_library(parseAPI common instructionAPI ${SYMREADER})
117
118 target_link_private_libraries(parseAPI ${Boost_LIBRARIES} ${TBB_LIBRARIES} tbbmalloc)
119
120 if (WIN32)
121 target_link_private_libraries(parseAPI shlwapi)
122 endif()
123 message(STATUS "Architecture is: ${CMAKE_LIBRARY_ARCHITECTURE}")
124 FILE (GLOB headers "h/*.h")
125 FILE (GLOB dataflowheaders "../dataflowAPI/h/*.h")
126 set_target_properties (parseAPI PROPERTIES PUBLIC_HEADER "${headers};${dataflowheaders}")
127
128 if (USE_OpenMP)
129 set_target_properties (parseAPI PROPERTIES COMPILE_FLAGS ${OpenMP_CXX_FLAGS} LINK_FLAGS ${OpenMP_CXX_FLAGS})
130 endif()
131
132 if (USE_COTIRE)
133     cotire(parseAPI)
134 endif()
135 if(${ENABLE_STATIC_LIBS})
136   set_target_properties (parseAPI_static PROPERTIES PUBLIC_HEADER "${headers};${dataflowheaders}")
137 endif()
138
139 install (TARGETS parseAPI
140     RUNTIME DESTINATION ${INSTALL_LIB_DIR}
141     LIBRARY DESTINATION ${INSTALL_LIB_DIR}
142     ARCHIVE DESTINATION ${INSTALL_LIB_DIR}
143     PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDE_DIR})