Manually specify RT lib .S files to be built with gcc.
[dyninst.git] / testsuite / x86_64-unknown-linux2.4 / CMakeLists.txt
1 # Build rules for the test libraries (libtestdyninst, libtestproccontrol, etc.)
2 # and the executables
3
4 foreach (def ${UNIFIED_DEFINES})
5   # add_definitions doesn't seem to get pulled in; that's okay, since
6   # we don't want it anyway (we want to override for mutators/ees)
7   remove_definitions (${def})
8   add_definitions (${def}_test)
9   set (MUTATEE_DEFINES "${MUTATEE_DEFINES} ${def}_test")
10 endforeach()
11
12 include_directories (../src
13                     ../src/dyninst
14                     ../src/proccontrol
15                     ../src/symtab
16                     ../src/instruction)
17
18 add_library (testSuite SHARED 
19             ../src/test_lib.C 
20             ../src/test_lib_soExecution.C
21             ../src/TestData.C
22             ../src/TestMutator.C
23             ../src/TestOutputDriver.C
24             ../src/StdOutputDriver.C
25             ../src/remotetest.C
26             ../src/connection.C
27             ../src/module.C
28             ../src/test_lib_templates.C)
29 target_link_libraries (testSuite dl)
30
31 add_library (testlaunch SHARED
32             ../src/CmdLine.C
33             ../src/ParameterDict.C
34             ../src/ResumeLog.C
35             ../src/MutateeStart.C
36             ../src/test_info_new.C
37             test_info_new.gen.C)
38 target_link_libraries (testlaunch)
39
40 add_library (testdyninst SHARED
41             ../src/dyninst/dyninst_comp.C
42             ../src/dyninst/test_lib_mutateeStart.C
43             ../src/dyninst/Callbacks.C
44             ../src/dyninst/Process_data.C
45             ../src/dyninst/ParseThat.C
46             ../src/dyninst/test_lib_test7.C
47             ../src/dyninst/test_lib_test9.C)
48 target_link_libraries (testdyninst dyninstAPI)
49
50 add_library (testsymtab SHARED
51             ../src/symtab/symtab_comp.C)
52 target_link_libraries (testsymtab symtabAPI)
53
54 add_library (testinstruction SHARED
55             ../src/instruction/instruction_comp.C)
56 target_link_libraries (testinstruction instructionAPI)
57
58 add_library (testproccontrol SHARED
59             ../src/proccontrol/proccontrol_comp.C)
60 target_link_libraries (testproccontrol pcontrol)
61
62 add_executable (runTests 
63                ../src/runTests.C
64                ../src/runTests-utils.C
65                ../src/test_driver_templates.C)
66 target_link_libraries (runTests)
67
68 add_executable (test_driver
69                ../src/test_driver.C
70                ../src/test_driver_templates.C
71                ../src/dynlmon.C
72                ../src/testdriver_be.C
73                test_info_new.gen.C)
74 target_link_libraries (test_driver testSuite testlaunch)
75
76
77 add_executable (testdriver_wrapper
78                ../src/connection.C
79                ../src/testdriver_wrapper.C)
80
81 install (TARGETS
82         test_driver
83         testdriver_wrapper
84         runTests
85         testSuite
86         testlaunch
87         testdyninst
88         testsymtab
89         testinstruction
90         testproccontrol
91         DESTINATION testsuite)
92
93
94
95 include (cmake-mutators.txt)
96
97
98
99 # Compiler macros
100 FIND_PROGRAM(M_gnu_cc NAMES gcc)
101 FIND_PROGRAM(M_gnu_cxx NAMES g++)
102 FIND_PROGRAM(M_intel_cc NAMES icc)
103 FIND_PROGRAM(M_intel_CC NAMES icpc)
104 FIND_PROGRAM(M_pg_cc NAMES pgcc)
105 FIND_PROGRAM(M_pg_cxx NAMES pgCC)
106
107 include (cmake-compilers.txt)
108
109 add_library (testA SHARED ../src/libtestA.c)
110 add_library (testB SHARED ../src/libtestB.c)
111 add_library (Test12 SHARED ../src/dyninst/libTest12.c)
112
113 if (${MUTATEE_gcc32dyn})
114 add_library (testA_m32 SHARED ../src/libtestA.c)
115 add_library (testB_m32 SHARED ../src/libtestB.c)
116 add_library (Test12_m32 SHARED ../src/dyninst/libTest12.c)
117
118 set_target_properties (testA_m32
119                       PROPERTIES
120                       COMPILE_FLAGS "-m32"
121                       LINK_FLAGS "-m32")
122 set_target_properties (testB_m32
123                       PROPERTIES
124                       COMPILE_FLAGS "-m32"
125                       LINK_FLAGS "-m32")
126 set_target_properties (Test12_m32
127                       PROPERTIES
128                       COMPILE_FLAGS "-m32"
129                       LINK_FLAGS "-m32")
130 endif()
131
132 include (cmake-mutatees.txt)
133