Add x86 xsavec instruction (#1074)
[dyninst.git] / common / CMakeLists.txt
1 # CMake configuration for common directory
2
3 if(NOT WIN32)
4 include_directories (
5     ${PROJECT_SOURCE_DIR}/common/h 
6     ${PROJECT_SOURCE_DIR}/common/src
7   )
8 else()
9 include_directories (
10     ${PROJECT_SOURCE_DIR}/common/h # don't include common/src; anything from there can still collide with default includes.
11         # stupid Windows case-insensitive naming.
12   )
13 endif()
14
15
16 set (SRC_LIST
17     src/pfq-rwlock.C
18     src/concurrent.C
19     src/string-regex.C
20     src/Timer.C 
21     src/Types.C 
22     src/lprintf.C
23     src/pathName.C 
24     src/Time.C 
25     src/fraction.C
26     src/timing.C 
27     src/stats.C 
28     src/Annotatable.C 
29     src/MappedFile.C 
30     src/sha1.C 
31     src/util.C
32     src/Node.C 
33     src/Graph.C 
34     src/Edge.C 
35     src/DOT.C 
36     src/dyn_regs.C 
37     src/AST.C 
38     src/addrtranslate.C 
39     src/arch-x86.C 
40     src/arch-power.C 
41         src/arch-aarch64.C
42     src/debug_common.C 
43     src/VariableLocation.C 
44     src/Buffer.C
45     src/MachSyscall.C
46   )
47
48 set (C_SRC_LIST
49 )
50
51 if (PLATFORM MATCHES freebsd)
52   set (SRC_LIST ${SRC_LIST} 
53     src/timing-freebsd.C
54     src/freebsdKludges.C
55     src/addrtranslate-sysv.C
56     src/addrtranslate-freebsd.C
57     src/symbolDemangleWithCache.C
58   )
59   set (C_SRC_LIST ${C_SRC_LIST}
60     src/symbolDemangle.c
61   )
62 endif()
63
64 if (PLATFORM MATCHES linux)
65   set (SRC_LIST ${SRC_LIST}
66     src/linuxKludges.C
67     src/timing-linux.C
68     src/parseauxv.C
69     src/addrtranslate-sysv.C
70     src/addrtranslate-auxv.C
71     src/addrtranslate-linux.C
72     src/symbolDemangleWithCache.C
73   )
74   set (C_SRC_LIST ${C_SRC_LIST}
75     src/symbolDemangle.c
76   )
77 endif()
78
79 if (PLATFORM MATCHES cnl)
80   set (SRC_LIST ${SRC_LIST}
81     src/linuxKludges.C
82     src/timing-linux.C
83     src/parseauxv.C
84     src/addrtranslate-sysv.C
85     src/addrtranslate-auxv.C
86     src/addrtranslate-linux.C
87   )
88 endif()  
89
90 if (PLATFORM MATCHES nt OR PLATFORM MATCHES windows)
91   set (SRC_LIST ${SRC_LIST}
92     src/ntKludges.C
93     src/timing-nt.C
94 #    src/dthread-win.C
95 #       src/dthread.C
96     src/addrtranslate-win.C
97   )
98   add_definitions(-DWIN32 -D_WIN32_WINNT=0x500)
99 endif()  
100
101
102 SET_SOURCE_FILES_PROPERTIES(${SRC_LIST} PROPERTIES LANGUAGE CXX)
103 SET_SOURCE_FILES_PROPERTIES(${C_SRC_LIST} PROPERTIES LANGUAGE C)
104 set (SRC_LIST ${SRC_LIST}
105   ${C_SRC_LIST}
106 )
107
108 ADD_DEFINITIONS(-DCOMMON_LIB)
109
110 dyninst_library(common)
111
112 if(TARGET LibIberty)
113   add_dependencies(common LibIberty)
114   target_link_libraries(common PRIVATE LibIberty)
115
116   if(${ENABLE_STATIC_LIBS})
117           target_link_libraries(common_static PRIVATE LibIberty)
118   endif()
119 endif()
120
121 if(TARGET TBB)
122     add_dependencies(common TBB)
123 endif()
124 if(PLATFORM MATCHES nt OR PLATFORM MATCHES windows)
125   target_link_private_libraries(common Psapi WS2_32 dbghelp)
126 endif()
127 target_link_private_libraries(common ${Boost_LIBRARIES})
128 target_link_libraries(common PUBLIC ${TBB_LIBRARIES})
129
130 if(USE_OpenMP)
131   set_target_properties(common PROPERTIES COMPILE_FLAGS ${OpenMP_CXX_FLAGS} LINK_FLAGS ${OpenMP_CXX_FLAGS})
132 endif()
133