Do not put newly added functions to .dynsym, which may cause the load
[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     ${CILKSCREEN_INCLUDES}
13   )
14 endif()
15
16
17 set (SRC_LIST
18     src/mcs-lock.C
19     src/pfq-rwlock.C
20     src/race-detector-annotations.C
21     src/string-regex.C
22     src/Timer.C 
23     src/Types.C 
24     src/lprintf.C
25     src/pathName.C 
26     src/Time.C 
27     src/fraction.C
28     src/timing.C 
29     src/stats.C 
30     src/Annotatable.C 
31     src/MappedFile.C 
32     src/sha1.C 
33     src/util.C
34     src/Node.C 
35     src/Graph.C 
36     src/Edge.C 
37     src/DOT.C 
38     src/dyn_regs.C 
39     src/AST.C 
40     src/addrtranslate.C 
41     src/arch-x86.C 
42     src/arch-power.C 
43         src/arch-aarch64.C
44     src/debug_common.C 
45     src/VariableLocation.C 
46     src/Buffer.C
47     src/MachSyscall.C
48   )
49
50 if (PLATFORM MATCHES freebsd)
51   set (SRC_LIST ${SRC_LIST} 
52     src/timing-freebsd.C
53     src/freebsdKludges.C
54     src/addrtranslate-sysv.C
55     src/addrtranslate-freebsd.C
56   )
57 endif()
58
59 if (PLATFORM MATCHES linux)
60   set (SRC_LIST ${SRC_LIST}
61     src/linuxKludges.C
62     src/timing-linux.C
63     src/parseauxv.C
64     src/addrtranslate-sysv.C
65     src/addrtranslate-auxv.C
66     src/addrtranslate-linux.C
67   )
68 endif()
69
70 if (PLATFORM MATCHES bgq)
71   set (SRC_LIST ${SRC_LIST}
72     src/bluegeneKludges.C
73     src/timing-linux.C
74     src/parseauxv.C
75     src/addrtranslate-sysv.C
76     src/addrtranslate-auxv.C
77     src/addrtranslate-bluegene.C
78   )
79 endif()
80
81 if (PLATFORM MATCHES cnl)
82   set (SRC_LIST ${SRC_LIST}
83     src/linuxKludges.C
84     src/timing-linux.C
85     src/parseauxv.C
86     src/addrtranslate-sysv.C
87     src/addrtranslate-auxv.C
88     src/addrtranslate-linux.C
89   )
90 endif()  
91
92 if (PLATFORM MATCHES nt OR PLATFORM MATCHES windows)
93   set (SRC_LIST ${SRC_LIST}
94     src/ntKludges.C
95     src/timing-nt.C
96 #    src/dthread-win.C
97 #       src/dthread.C
98     src/addrtranslate-win.C
99   )
100   add_definitions(-DWIN32 -D_WIN32_WINNT=0x500)
101 endif()  
102
103
104 SET_SOURCE_FILES_PROPERTIES(${SRC_LIST} PROPERTIES LANGUAGE CXX)
105
106 ADD_DEFINITIONS(-DCOMMON_LIB)
107
108 if (IBERTY_FOUND)
109 set(DEPS ${IBERTY_LIBRARIES})
110 endif()
111
112
113 dyninst_library(common ${DEPS})
114 if(PLATFORM MATCHES nt OR PLATFORM MATCHES windows)
115   target_link_private_libraries(common Psapi WS2_32 dbghelp)
116 endif()
117 target_link_private_libraries(common ${Boost_LIBRARIES})
118 target_link_libraries(common PUBLIC ${TBB_LIBRARIES})
119
120 IF (USE_COTIRE)
121     cotire(common)
122 ENDIF()
123