Merge pull request #13 from pefoley2/clang
[dyninst.git] / symtabAPI / CMakeLists.txt
1 # CMake configuration for symtabAPI directory
2
3 include_directories (
4   src
5   h
6   ${PROJECT_SOURCE_DIR}/dwarf/h
7   ${PROJECT_SOURCE_DIR}/elf/h
8   )
9
10 if(NOT WIN32)
11   include_directories(${PROJECT_SOURCE_DIR}/common/src)
12 endif()
13
14
15
16 set (SRC_LIST
17                 src/Object.C 
18                 src/Aggregate.C 
19                 src/Function.C 
20                 src/Variable.C 
21                 src/Symbol.C 
22                 src/LineInformation.C 
23                 src/Symtab.C 
24                 src/Symtab-edit.C 
25                 src/Symtab-lookup.C 
26                 src/Symtab-deprecated.C 
27                 src/Module.C 
28                 src/Region.C 
29                 src/Collections.C 
30                 src/Type.C 
31                 src/AddrLookup.C 
32                 src/annotations.C 
33                 src/debug.C 
34                 src/SymtabReader.C 
35   )
36
37 if (PLATFORM MATCHES freebsd OR 
38     PLATFORM MATCHES linux OR 
39     PLATFORM MATCHES bgq OR
40     PLATFORM MATCHES cnl)
41
42 set (SRC_LIST ${SRC_LIST}
43     src/Object-elf.C 
44     src/Archive.C 
45     src/Archive-elf.C 
46     src/parseDwarf.C
47         src/parseStab.C
48         src/LinkMap.C
49     src/emitElfStatic.C 
50     src/dwarfWalker.C
51 )
52
53 if (PLATFORM MATCHES x86_64 OR PLATFORM MATCHES amd64)
54 set (SRC_LIST ${SRC_LIST}
55     src/emitElf-64.C
56     src/emitElfStatic-x86.C 
57     src/relocationEntry-elf-x86.C
58     )
59 elseif (PLATFORM MATCHES i386)
60 set (SRC_LIST ${SRC_LIST}
61     src/emitElfStatic-x86.C
62     src/relocationEntry-elf-x86.C
63     )
64 elseif (PLATFORM MATCHES ppc32)
65 set (SRC_LIST ${SRC_LIST}
66     src/emitElfStatic-ppc32.C 
67     src/relocationEntry-elf-ppc32.C
68     )
69 elseif (PLATFORM MATCHES ppc64)
70 set (SRC_LIST ${SRC_LIST}
71     src/emitElf-64.C
72     src/emitElfStatic-ppc64.C
73     src/relocationEntry-elf-ppc64.C
74     )
75 elseif (PLATFORM MATCHES aarch64)
76 set (SRC_LIST ${SRC_LIST}
77     src/emitElf-64.C
78     src/emitElfStatic-aarch64.C
79     src/relocationEntry-elf-aarch64.C
80     )
81 else (TRUE)
82 set (SRC_LIST ${SRC_LIST}
83     src/emitElf-64.C
84     src/emitElfStatic-stub.C
85     src/relocationEntry-stub.C
86     )
87 endif()
88 endif()
89
90
91 if (PLATFORM MATCHES nt)
92 set (SRC_LIST ${SRC_LIST}
93     src/Object-nt.C
94         src/emitWin.C
95         src/relocationEntry-stub.C
96 )
97 endif()
98
99 SET_SOURCE_FILES_PROPERTIES(${SRC_LIST} PROPERTIES LANGUAGE CXX)
100
101 ADD_DEFINITIONS(-DSYMTAB_LIB)
102
103 set (DEPS common)
104
105 if(UNIX)
106   set (DEPS ${DEPS}
107     dynElf ${LIBELF_LIBRARIES}
108     dynDwarf ${LIBDWARF_LIBRARIES}
109     )
110 else()
111   set (DEPS ${DEPS} dbghelp)
112 endif()
113
114 dyninst_library(symtabAPI ${DEPS})
115