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 | |||||
Dave Barach | c74b43c | 2020-04-09 17:24:07 -0400 | [diff] [blame] | 14 | option(VPP_BUFFER_FAULT_INJECTOR "Include the buffer fault injector" OFF) |
15 | |||||
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 16 | ############################################################################## |
17 | # Generate vlib/config.h | ||||
18 | ############################################################################## | ||||
Dave Barach | c74b43c | 2020-04-09 17:24:07 -0400 | [diff] [blame] | 19 | if(VPP_BUFFER_FAULT_INJECTOR) |
20 | set(BUFFER_ALLOC_FAULT_INJECTOR 1 CACHE STRING "fault injector on") | ||||
21 | else() | ||||
22 | set(BUFFER_ALLOC_FAULT_INJECTOR 0 CACHE STRING "fault injector off") | ||||
23 | endif() | ||||
24 | |||||
Damjan Marion | 038dad7 | 2024-01-19 21:19:57 +0100 | [diff] [blame] | 25 | if(VPP_PLATFORM_BUFFER_ALIGN) |
26 | set(VLIB_BUFFER_ALIGN ${VPP_PLATFORM_BUFFER_ALIGN}) | ||||
27 | else() | ||||
28 | set(VLIB_BUFFER_ALIGN ${VPP_CACHE_LINE_SIZE}) | ||||
29 | endif() | ||||
30 | |||||
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 31 | set(PRE_DATA_SIZE 128 CACHE STRING "Buffer headroom size.") |
Damjan Marion | ef58758 | 2020-05-20 22:01:44 +0200 | [diff] [blame] | 32 | |
33 | if (CMAKE_BUILD_TYPE_UC STREQUAL "DEBUG") | ||||
34 | set(_ss 16) | ||||
35 | else() | ||||
36 | set(_ss 15) | ||||
37 | endif() | ||||
38 | set(VLIB_PROCESS_LOG2_STACK_SIZE | ||||
39 | ${_ss} | ||||
40 | CACHE | ||||
41 | STRING "Process node default stack size (log2)" | ||||
42 | ) | ||||
43 | |||||
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 44 | configure_file( |
45 | ${CMAKE_SOURCE_DIR}/vlib/config.h.in | ||||
Damjan Marion | 88b2e36 | 2021-04-29 18:47:25 +0200 | [diff] [blame] | 46 | ${CMAKE_CURRENT_BINARY_DIR}/config.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 47 | ) |
Damjan Marion | 833de8c | 2018-09-07 12:39:02 +0200 | [diff] [blame] | 48 | install( |
Damjan Marion | 88b2e36 | 2021-04-29 18:47:25 +0200 | [diff] [blame] | 49 | FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h |
Nick Brown | e3cf4d0 | 2021-09-15 14:25:40 +0100 | [diff] [blame] | 50 | DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/vlib |
Damjan Marion | 833de8c | 2018-09-07 12:39:02 +0200 | [diff] [blame] | 51 | COMPONENT vpp-dev |
52 | ) | ||||
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 53 | |
54 | ############################################################################## | ||||
55 | # vlib shared library | ||||
56 | ############################################################################## | ||||
Tom Jones | 532a1ce | 2024-01-29 10:33:36 +0000 | [diff] [blame] | 57 | |
Tom Jones | e625d0e | 2024-04-25 14:19:03 +0000 | [diff] [blame] | 58 | if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") |
Tom Jones | 532a1ce | 2024-01-29 10:33:36 +0000 | [diff] [blame] | 59 | set(PLATFORM_SOURCES |
60 | linux/pci.c | ||||
61 | linux/vfio.c | ||||
62 | linux/vmbus.c | ||||
63 | ) | ||||
64 | |||||
65 | set(PLATFORM_HEADERS | ||||
66 | linux/vfio.h | ||||
67 | ) | ||||
Tom Jones | e625d0e | 2024-04-25 14:19:03 +0000 | [diff] [blame] | 68 | elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD") |
69 | set(PLATFORM_SOURCES | ||||
70 | freebsd/pci.c | ||||
71 | ) | ||||
72 | endif() | ||||
Tom Jones | 532a1ce | 2024-01-29 10:33:36 +0000 | [diff] [blame] | 73 | |
Damjan Marion | 4553c95 | 2018-08-26 11:04:40 +0200 | [diff] [blame] | 74 | add_vpp_library(vlib |
75 | SOURCES | ||||
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 76 | buffer.c |
Damjan Marion | 1c22971 | 2021-04-21 12:55:15 +0200 | [diff] [blame] | 77 | buffer_funcs.c |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 78 | cli.c |
79 | counter.c | ||||
Neale Ranns | 22e1f1d | 2019-03-01 15:53:11 +0000 | [diff] [blame] | 80 | drop.c |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 81 | error.c |
82 | format.c | ||||
Dave Barach | a638c18 | 2019-06-21 18:24:07 -0400 | [diff] [blame] | 83 | handoff_trace.c |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 84 | init.c |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 85 | log.c |
86 | main.c | ||||
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 87 | node.c |
88 | node_cli.c | ||||
89 | node_format.c | ||||
Ray Kinsella | 4830e4f | 2020-03-10 14:35:32 +0000 | [diff] [blame] | 90 | node_init.c |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 91 | pci/pci.c |
Jakub Grajciar | 53f06a0 | 2020-03-30 08:12:57 +0200 | [diff] [blame] | 92 | pci/pci_types_api.c |
Damjan Marion | 68b4da6 | 2018-09-30 18:26:20 +0200 | [diff] [blame] | 93 | physmem.c |
Neale Ranns | 76b5649 | 2018-09-28 15:16:14 +0000 | [diff] [blame] | 94 | punt.c |
95 | punt_node.c | ||||
Damjan Marion | 8973b07 | 2022-03-01 15:51:18 +0100 | [diff] [blame] | 96 | stats/cli.c |
97 | stats/collector.c | ||||
98 | stats/format.c | ||||
99 | stats/init.c | ||||
100 | stats/provider_mem.c | ||||
101 | stats/stats.c | ||||
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 102 | threads.c |
103 | threads_cli.c | ||||
Benoît Ganne | 56eccdb | 2021-08-20 09:18:31 +0200 | [diff] [blame] | 104 | time.c |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 105 | trace.c |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 106 | unix/cli.c |
107 | unix/input.c | ||||
108 | unix/main.c | ||||
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 109 | unix/plugin.c |
110 | unix/util.c | ||||
Stephen Hemminger | 6fbef23 | 2018-10-15 12:52:30 -0700 | [diff] [blame] | 111 | vmbus/vmbus.c |
Marvin Liu | abd5669 | 2022-08-17 09:38:40 +0800 | [diff] [blame] | 112 | dma/dma.c |
113 | dma/cli.c | ||||
Tom Jones | 532a1ce | 2024-01-29 10:33:36 +0000 | [diff] [blame] | 114 | ${PLATFORM_SOURCES} |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 115 | |
Neale Ranns | 22e1f1d | 2019-03-01 15:53:11 +0000 | [diff] [blame] | 116 | MULTIARCH_SOURCES |
Damjan Marion | 1c22971 | 2021-04-21 12:55:15 +0200 | [diff] [blame] | 117 | buffer_funcs.c |
Neale Ranns | 22e1f1d | 2019-03-01 15:53:11 +0000 | [diff] [blame] | 118 | drop.c |
Neale Ranns | 76b5649 | 2018-09-28 15:16:14 +0000 | [diff] [blame] | 119 | punt_node.c |
Ray Kinsella | 4830e4f | 2020-03-10 14:35:32 +0000 | [diff] [blame] | 120 | node_init.c |
Neale Ranns | 22e1f1d | 2019-03-01 15:53:11 +0000 | [diff] [blame] | 121 | |
Damjan Marion | 4553c95 | 2018-08-26 11:04:40 +0200 | [diff] [blame] | 122 | INSTALL_HEADERS |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 123 | buffer_funcs.h |
124 | buffer.h | ||||
125 | buffer_node.h | ||||
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 126 | cli.h |
127 | counter.h | ||||
Ole Troan | 58492a8 | 2018-09-04 13:19:12 +0200 | [diff] [blame] | 128 | counter_types.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 129 | defs.h |
Mohammed Hawari | 463d5f9 | 2023-01-17 12:18:15 +0100 | [diff] [blame] | 130 | dma/dma.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 131 | error_funcs.h |
132 | error.h | ||||
133 | format_funcs.h | ||||
134 | global_funcs.h | ||||
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 135 | init.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 136 | log.h |
137 | main.h | ||||
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 138 | node_funcs.h |
139 | node.h | ||||
140 | pci/pci_config.h | ||||
141 | pci/pci.h | ||||
Jakub Grajciar | 53f06a0 | 2020-03-30 08:12:57 +0200 | [diff] [blame] | 142 | pci/pci_types_api.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 143 | physmem_funcs.h |
144 | physmem.h | ||||
Neale Ranns | 76b5649 | 2018-09-28 15:16:14 +0000 | [diff] [blame] | 145 | punt.h |
Damjan Marion | 8973b07 | 2022-03-01 15:51:18 +0100 | [diff] [blame] | 146 | stats/shared.h |
147 | stats/stats.h | ||||
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 148 | threads.h |
Benoît Ganne | 56eccdb | 2021-08-20 09:18:31 +0200 | [diff] [blame] | 149 | time.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 150 | trace_funcs.h |
151 | trace.h | ||||
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 152 | unix/mc_socket.h |
153 | unix/plugin.h | ||||
154 | unix/unix.h | ||||
155 | vlib.h | ||||
Stephen Hemminger | 6fbef23 | 2018-10-15 12:52:30 -0700 | [diff] [blame] | 156 | vmbus/vmbus.h |
Tom Jones | 532a1ce | 2024-01-29 10:33:36 +0000 | [diff] [blame] | 157 | ${PLATFORM_HEADERS} |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 158 | |
Jakub Grajciar | 53f06a0 | 2020-03-30 08:12:57 +0200 | [diff] [blame] | 159 | API_FILES |
160 | pci/pci_types.api | ||||
161 | |||||
Tom Jones | 5ed27ef | 2024-01-29 14:38:19 +0000 | [diff] [blame] | 162 | LINK_LIBRARIES vppinfra svm ${CMAKE_DL_LIBS} ${EPOLL_LIB} |
Jakub Grajciar | 53f06a0 | 2020-03-30 08:12:57 +0200 | [diff] [blame] | 163 | |
164 | DEPENDS api_headers | ||||
Damjan Marion | 4553c95 | 2018-08-26 11:04:40 +0200 | [diff] [blame] | 165 | ) |