Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 1 | # Copyright (c) 2018 Cisco and/or its affiliates. |
2 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||||
3 | # you may not use this file except in compliance with the License. | ||||
4 | # You may obtain a copy of the License at: | ||||
5 | # | ||||
6 | # http://www.apache.org/licenses/LICENSE-2.0 | ||||
7 | # | ||||
8 | # Unless required by applicable law or agreed to in writing, software | ||||
9 | # distributed under the License is distributed on an "AS IS" BASIS, | ||||
10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
11 | # See the License for the specific language governing permissions and | ||||
12 | # limitations under the License. | ||||
13 | |||||
14 | enable_language(ASM) | ||||
15 | |||||
16 | ############################################################################## | ||||
17 | # Generate vppinfra/config.h | ||||
18 | ############################################################################## | ||||
Damjan Marion | edc4387 | 2018-09-02 11:16:00 +0200 | [diff] [blame] | 19 | set(LOG2_CACHE_LINE_BYTES ${VPP_LOG2_CACHE_LINE_SIZE}) |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 20 | |
21 | configure_file( | ||||
22 | ${CMAKE_SOURCE_DIR}/vppinfra/config.h.in | ||||
23 | ${CMAKE_BINARY_DIR}/vppinfra/config.h | ||||
24 | ) | ||||
25 | |||||
26 | install( | ||||
27 | FILES ${CMAKE_BINARY_DIR}/vppinfra/config.h | ||||
28 | DESTINATION include/vppinfra | ||||
Damjan Marion | 43b0606 | 2018-08-29 22:20:45 +0200 | [diff] [blame] | 29 | COMPONENT vpp-dev |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 30 | ) |
31 | |||||
32 | ############################################################################## | ||||
33 | # vppinfra sources | ||||
34 | ############################################################################## | ||||
35 | set(VPPINFRA_SRCS | ||||
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 36 | backtrace.c |
Dave Barach | 32dcd3b | 2019-07-08 12:25:38 -0400 | [diff] [blame] | 37 | bihash_all_vector.c |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 38 | cpu.c |
39 | cuckoo_template.c | ||||
Dave Barach | 2c8e002 | 2020-02-11 15:06:34 -0500 | [diff] [blame^] | 40 | dlmalloc.c |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 41 | elf.c |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 42 | elog.c |
43 | error.c | ||||
44 | fheap.c | ||||
45 | fifo.c | ||||
46 | format.c | ||||
47 | graph.c | ||||
48 | hash.c | ||||
49 | heap.c | ||||
50 | longjmp.S | ||||
51 | macros.c | ||||
52 | maplog.c | ||||
Dave Barach | 2c8e002 | 2020-02-11 15:06:34 -0500 | [diff] [blame^] | 53 | mem_dlmalloc.c |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 54 | mhash.c |
Gary Boon | a9ed6f7 | 2019-07-22 10:57:56 -0400 | [diff] [blame] | 55 | mpcap.c |
Dave Barach | 3ae2873 | 2018-11-16 17:19:00 -0500 | [diff] [blame] | 56 | pcap.c |
Damjan Marion | 68b4da6 | 2018-09-30 18:26:20 +0200 | [diff] [blame] | 57 | pmalloc.c |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 58 | pool.c |
59 | ptclosure.c | ||||
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 60 | random_buffer.c |
Dave Barach | 2c8e002 | 2020-02-11 15:06:34 -0500 | [diff] [blame^] | 61 | random.c |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 62 | random_isaac.c |
Florin Coras | 672d5fc | 2019-04-15 17:28:51 -0700 | [diff] [blame] | 63 | rbtree.c |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 64 | serialize.c |
65 | slist.c | ||||
66 | socket.c | ||||
67 | std-formats.c | ||||
68 | string.c | ||||
69 | time.c | ||||
70 | time_range.c | ||||
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 71 | timing_wheel.c |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 72 | tw_timer_16t_1w_2048sl.c |
Dave Barach | 2c8e002 | 2020-02-11 15:06:34 -0500 | [diff] [blame^] | 73 | tw_timer_16t_2w_512sl.c |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 74 | tw_timer_1t_3w_1024sl_ov.c |
Dave Barach | 2c8e002 | 2020-02-11 15:06:34 -0500 | [diff] [blame^] | 75 | tw_timer_2t_1w_2048sl.c |
76 | tw_timer_4t_3w_256sl.c | ||||
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 77 | unformat.c |
78 | unix-formats.c | ||||
79 | unix-misc.c | ||||
80 | valloc.c | ||||
81 | vec.c | ||||
82 | vector.c | ||||
83 | zvec.c | ||||
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 84 | ) |
85 | |||||
Damjan Marion | 4553c95 | 2018-08-26 11:04:40 +0200 | [diff] [blame] | 86 | set(VPPINFRA_HEADERS |
BenoƮt Ganne | 9fb6d40 | 2019-04-15 15:28:21 +0200 | [diff] [blame] | 87 | sanitizer.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 88 | bihash_16_8.h |
89 | bihash_24_8.h | ||||
90 | bihash_40_8.h | ||||
91 | bihash_48_8.h | ||||
92 | bihash_8_8.h | ||||
93 | bihash_template.c | ||||
94 | bihash_template.h | ||||
95 | bihash_vec8_8.h | ||||
96 | bitmap.h | ||||
97 | bitops.h | ||||
98 | byte_order.h | ||||
99 | cache.h | ||||
Dave Barach | 5f2cfb2 | 2019-05-20 10:28:57 -0400 | [diff] [blame] | 100 | callback.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 101 | clib_error.h |
102 | clib.h | ||||
103 | cpu.h | ||||
104 | crc32.h | ||||
105 | dlist.h | ||||
106 | dlmalloc.h | ||||
107 | elf_clib.h | ||||
108 | elf.h | ||||
109 | elog.h | ||||
110 | error_bootstrap.h | ||||
111 | error.h | ||||
112 | fheap.h | ||||
113 | fifo.h | ||||
114 | file.h | ||||
115 | flowhash_24_16.h | ||||
116 | flowhash_8_8.h | ||||
117 | flowhash_template.h | ||||
118 | format.h | ||||
119 | graph.h | ||||
120 | hash.h | ||||
121 | heap.h | ||||
122 | lb_hash_hash.h | ||||
Florin Coras | b957d80 | 2019-07-09 19:02:33 -0700 | [diff] [blame] | 123 | llist.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 124 | lock.h |
125 | longjmp.h | ||||
126 | macros.h | ||||
127 | maplog.h | ||||
128 | math.h | ||||
129 | memcpy_avx2.h | ||||
130 | memcpy_avx512.h | ||||
131 | memcpy_sse3.h | ||||
132 | mem.h | ||||
133 | mhash.h | ||||
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 134 | mheap.h |
Gary Boon | a9ed6f7 | 2019-07-22 10:57:56 -0400 | [diff] [blame] | 135 | mpcap.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 136 | os.h |
Dave Barach | 3ae2873 | 2018-11-16 17:19:00 -0500 | [diff] [blame] | 137 | pcap.h |
138 | pcap_funcs.h | ||||
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 139 | pipeline.h |
Damjan Marion | 68b4da6 | 2018-09-30 18:26:20 +0200 | [diff] [blame] | 140 | pmalloc.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 141 | pool.h |
Dave Barach | 4d1a866 | 2018-09-10 12:31:15 -0400 | [diff] [blame] | 142 | pmc.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 143 | ptclosure.h |
144 | random_buffer.h | ||||
145 | random.h | ||||
146 | random_isaac.h | ||||
Florin Coras | 672d5fc | 2019-04-15 17:28:51 -0700 | [diff] [blame] | 147 | rbtree.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 148 | serialize.h |
Damjan Marion | cf18ca9 | 2019-04-13 00:13:34 +0200 | [diff] [blame] | 149 | sha2.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 150 | slist.h |
151 | smp.h | ||||
152 | socket.h | ||||
153 | sparse_vec.h | ||||
154 | string.h | ||||
155 | time.h | ||||
156 | time_range.h | ||||
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 157 | timing_wheel.h |
158 | tw_timer_16t_1w_2048sl.h | ||||
159 | tw_timer_16t_2w_512sl.h | ||||
160 | tw_timer_1t_3w_1024sl_ov.h | ||||
161 | tw_timer_2t_1w_2048sl.h | ||||
162 | tw_timer_4t_3w_256sl.h | ||||
163 | tw_timer_template.c | ||||
164 | tw_timer_template.h | ||||
165 | types.h | ||||
Sirshak Das | 2f6d7bb | 2018-10-03 22:53:51 +0000 | [diff] [blame] | 166 | atomics.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 167 | unix.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 168 | valloc.h |
169 | vec_bootstrap.h | ||||
170 | vec.h | ||||
171 | vector_altivec.h | ||||
172 | vector_avx2.h | ||||
173 | vector_avx512.h | ||||
174 | vector_funcs.h | ||||
175 | vector.h | ||||
176 | vector_neon.h | ||||
177 | vector_sse42.h | ||||
178 | xxhash.h | ||||
179 | xy.h | ||||
180 | zvec.h | ||||
181 | linux/syscall.h | ||||
182 | linux/sysfs.h | ||||
183 | ) | ||||
184 | |||||
Damjan Marion | 4dffd1c | 2018-09-03 12:30:36 +0200 | [diff] [blame] | 185 | if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") |
186 | list(APPEND VPPINFRA_SRCS | ||||
187 | elf_clib.c | ||||
188 | linux/mem.c | ||||
189 | linux/sysfs.c | ||||
190 | ) | ||||
191 | endif() | ||||
192 | |||||
Damjan Marion | 4553c95 | 2018-08-26 11:04:40 +0200 | [diff] [blame] | 193 | add_vpp_library(vppinfra |
194 | SOURCES ${VPPINFRA_SRCS} | ||||
Florin Coras | 4c95995 | 2020-02-09 18:09:31 +0000 | [diff] [blame] | 195 | LINK_LIBRARIES m |
Damjan Marion | 4553c95 | 2018-08-26 11:04:40 +0200 | [diff] [blame] | 196 | INSTALL_HEADERS ${VPPINFRA_HEADERS} |
Damjan Marion | 43b0606 | 2018-08-29 22:20:45 +0200 | [diff] [blame] | 197 | COMPONENT libvppinfra |
Damjan Marion | 4553c95 | 2018-08-26 11:04:40 +0200 | [diff] [blame] | 198 | ) |
199 | |||||
200 | ############################################################################## | ||||
201 | # vppinfra headers | ||||
202 | ############################################################################## | ||||
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 203 | option(VPP_BUILD_VPPINFRA_TESTS "Build vppinfra tests." OFF) |
204 | if(VPP_BUILD_VPPINFRA_TESTS) | ||||
Damjan Marion | 4553c95 | 2018-08-26 11:04:40 +0200 | [diff] [blame] | 205 | foreach(test |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 206 | bihash_vec88 |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 207 | cuckoo_template |
208 | dlist | ||||
209 | elf | ||||
210 | elog | ||||
211 | fifo | ||||
212 | flowhash_template | ||||
213 | format | ||||
214 | fpool | ||||
215 | hash | ||||
216 | heap | ||||
217 | longjmp | ||||
218 | macros | ||||
219 | maplog | ||||
Damjan Marion | 68b4da6 | 2018-09-30 18:26:20 +0200 | [diff] [blame] | 220 | pmalloc |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 221 | pool_iterate |
222 | ptclosure | ||||
223 | random | ||||
224 | random_isaac | ||||
jaszha03 | 25ab6cf | 2019-07-01 17:20:52 -0500 | [diff] [blame] | 225 | rwlock |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 226 | serialize |
227 | slist | ||||
228 | socket | ||||
jaszha03 | 9a4e631 | 2019-06-19 14:07:05 -0500 | [diff] [blame] | 229 | spinlock |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 230 | time |
231 | time_range | ||||
232 | timing_wheel | ||||
233 | tw_timer | ||||
234 | valloc | ||||
235 | vec | ||||
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 236 | zvec |
237 | ) | ||||
Damjan Marion | 4553c95 | 2018-08-26 11:04:40 +0200 | [diff] [blame] | 238 | add_vpp_executable(test_${test} |
239 | SOURCES test_${test}.c | ||||
Florin Coras | 4f94464 | 2019-08-01 10:54:06 -0700 | [diff] [blame] | 240 | LINK_LIBRARIES vppinfra pthread |
Damjan Marion | 4553c95 | 2018-08-26 11:04:40 +0200 | [diff] [blame] | 241 | ) |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 242 | endforeach() |
243 | |||||
Damjan Marion | 4553c95 | 2018-08-26 11:04:40 +0200 | [diff] [blame] | 244 | foreach(test bihash_template cuckoo_bihash) |
245 | add_vpp_executable(test_${test} | ||||
246 | SOURCES test_${test}.c | ||||
247 | LINK_LIBRARIES vppinfra Threads::Threads | ||||
248 | ) | ||||
249 | endforeach() | ||||
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 250 | endif(VPP_BUILD_VPPINFRA_TESTS) |