blob: 9c4121672a59194934e550070af07ce568a2a798 [file] [log] [blame]
Damjan Marion612dd6a2018-07-30 12:45:07 +02001# 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 Barachc74b43c2020-04-09 17:24:07 -040014option(VPP_BUFFER_FAULT_INJECTOR "Include the buffer fault injector" OFF)
15
Damjan Marion612dd6a2018-07-30 12:45:07 +020016##############################################################################
17# Generate vlib/config.h
18##############################################################################
Dave Barachc74b43c2020-04-09 17:24:07 -040019if(VPP_BUFFER_FAULT_INJECTOR)
20 set(BUFFER_ALLOC_FAULT_INJECTOR 1 CACHE STRING "fault injector on")
21else()
22 set(BUFFER_ALLOC_FAULT_INJECTOR 0 CACHE STRING "fault injector off")
23endif()
24
Damjan Marion038dad72024-01-19 21:19:57 +010025if(VPP_PLATFORM_BUFFER_ALIGN)
26 set(VLIB_BUFFER_ALIGN ${VPP_PLATFORM_BUFFER_ALIGN})
27else()
28 set(VLIB_BUFFER_ALIGN ${VPP_CACHE_LINE_SIZE})
29endif()
30
Damjan Marion612dd6a2018-07-30 12:45:07 +020031set(PRE_DATA_SIZE 128 CACHE STRING "Buffer headroom size.")
Damjan Marionef587582020-05-20 22:01:44 +020032
33if (CMAKE_BUILD_TYPE_UC STREQUAL "DEBUG")
34 set(_ss 16)
35else()
36 set(_ss 15)
37endif()
38set(VLIB_PROCESS_LOG2_STACK_SIZE
39 ${_ss}
40 CACHE
41 STRING "Process node default stack size (log2)"
42)
43
Damjan Marion612dd6a2018-07-30 12:45:07 +020044configure_file(
45 ${CMAKE_SOURCE_DIR}/vlib/config.h.in
Damjan Marion88b2e362021-04-29 18:47:25 +020046 ${CMAKE_CURRENT_BINARY_DIR}/config.h
Damjan Marion612dd6a2018-07-30 12:45:07 +020047)
Damjan Marion833de8c2018-09-07 12:39:02 +020048install(
Damjan Marion88b2e362021-04-29 18:47:25 +020049 FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h
Nick Browne3cf4d02021-09-15 14:25:40 +010050 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/vlib
Damjan Marion833de8c2018-09-07 12:39:02 +020051 COMPONENT vpp-dev
52)
Damjan Marion612dd6a2018-07-30 12:45:07 +020053
54##############################################################################
55# vlib shared library
56##############################################################################
Damjan Marion4553c952018-08-26 11:04:40 +020057add_vpp_library(vlib
58 SOURCES
Damjan Marion612dd6a2018-07-30 12:45:07 +020059 buffer.c
Damjan Marion1c229712021-04-21 12:55:15 +020060 buffer_funcs.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020061 cli.c
62 counter.c
Neale Ranns22e1f1d2019-03-01 15:53:11 +000063 drop.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020064 error.c
65 format.c
Dave Baracha638c182019-06-21 18:24:07 -040066 handoff_trace.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020067 init.c
68 linux/pci.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020069 linux/vfio.c
Damjan Marion37066362023-07-28 20:06:09 +020070 linux/vmbus.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020071 log.c
72 main.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020073 node.c
74 node_cli.c
75 node_format.c
Ray Kinsella4830e4f2020-03-10 14:35:32 +000076 node_init.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020077 pci/pci.c
Jakub Grajciar53f06a02020-03-30 08:12:57 +020078 pci/pci_types_api.c
Damjan Marion68b4da62018-09-30 18:26:20 +020079 physmem.c
Neale Ranns76b56492018-09-28 15:16:14 +000080 punt.c
81 punt_node.c
Damjan Marion8973b072022-03-01 15:51:18 +010082 stats/cli.c
83 stats/collector.c
84 stats/format.c
85 stats/init.c
86 stats/provider_mem.c
87 stats/stats.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020088 threads.c
89 threads_cli.c
Benoît Ganne56eccdb2021-08-20 09:18:31 +020090 time.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020091 trace.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020092 unix/cli.c
93 unix/input.c
94 unix/main.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020095 unix/plugin.c
96 unix/util.c
Stephen Hemminger6fbef232018-10-15 12:52:30 -070097 vmbus/vmbus.c
Marvin Liuabd56692022-08-17 09:38:40 +080098 dma/dma.c
99 dma/cli.c
Damjan Marion612dd6a2018-07-30 12:45:07 +0200100
Neale Ranns22e1f1d2019-03-01 15:53:11 +0000101 MULTIARCH_SOURCES
Damjan Marion1c229712021-04-21 12:55:15 +0200102 buffer_funcs.c
Neale Ranns22e1f1d2019-03-01 15:53:11 +0000103 drop.c
Neale Ranns76b56492018-09-28 15:16:14 +0000104 punt_node.c
Ray Kinsella4830e4f2020-03-10 14:35:32 +0000105 node_init.c
Neale Ranns22e1f1d2019-03-01 15:53:11 +0000106
Damjan Marion4553c952018-08-26 11:04:40 +0200107 INSTALL_HEADERS
Damjan Marion612dd6a2018-07-30 12:45:07 +0200108 buffer_funcs.h
109 buffer.h
110 buffer_node.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200111 cli.h
112 counter.h
Ole Troan58492a82018-09-04 13:19:12 +0200113 counter_types.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200114 defs.h
Mohammed Hawari463d5f92023-01-17 12:18:15 +0100115 dma/dma.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200116 error_funcs.h
117 error.h
118 format_funcs.h
119 global_funcs.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200120 init.h
121 linux/vfio.h
122 log.h
123 main.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200124 node_funcs.h
125 node.h
126 pci/pci_config.h
127 pci/pci.h
Jakub Grajciar53f06a02020-03-30 08:12:57 +0200128 pci/pci_types_api.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200129 physmem_funcs.h
130 physmem.h
Neale Ranns76b56492018-09-28 15:16:14 +0000131 punt.h
Damjan Marion8973b072022-03-01 15:51:18 +0100132 stats/shared.h
133 stats/stats.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200134 threads.h
Benoît Ganne56eccdb2021-08-20 09:18:31 +0200135 time.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200136 trace_funcs.h
137 trace.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200138 unix/mc_socket.h
139 unix/plugin.h
140 unix/unix.h
141 vlib.h
Stephen Hemminger6fbef232018-10-15 12:52:30 -0700142 vmbus/vmbus.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200143
Jakub Grajciar53f06a02020-03-30 08:12:57 +0200144 API_FILES
145 pci/pci_types.api
146
Damjan Marion37066362023-07-28 20:06:09 +0200147 LINK_LIBRARIES vppinfra svm ${CMAKE_DL_LIBS}
Jakub Grajciar53f06a02020-03-30 08:12:57 +0200148
149 DEPENDS api_headers
Damjan Marion4553c952018-08-26 11:04:40 +0200150)