blob: ca8c27b07f95ec654a3cfb51e8778be04c929fe6 [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 Marion612dd6a2018-07-30 12:45:07 +020025set(PRE_DATA_SIZE 128 CACHE STRING "Buffer headroom size.")
Damjan Marionef587582020-05-20 22:01:44 +020026
27if (CMAKE_BUILD_TYPE_UC STREQUAL "DEBUG")
28 set(_ss 16)
29else()
30 set(_ss 15)
31endif()
32set(VLIB_PROCESS_LOG2_STACK_SIZE
33 ${_ss}
34 CACHE
35 STRING "Process node default stack size (log2)"
36)
37
Damjan Marion612dd6a2018-07-30 12:45:07 +020038configure_file(
39 ${CMAKE_SOURCE_DIR}/vlib/config.h.in
Damjan Marion88b2e362021-04-29 18:47:25 +020040 ${CMAKE_CURRENT_BINARY_DIR}/config.h
Damjan Marion612dd6a2018-07-30 12:45:07 +020041)
Damjan Marion833de8c2018-09-07 12:39:02 +020042install(
Damjan Marion88b2e362021-04-29 18:47:25 +020043 FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h
Nick Browne3cf4d02021-09-15 14:25:40 +010044 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/vlib
Damjan Marion833de8c2018-09-07 12:39:02 +020045 COMPONENT vpp-dev
46)
Damjan Marion612dd6a2018-07-30 12:45:07 +020047
48##############################################################################
Stephen Hemminger6fbef232018-10-15 12:52:30 -070049# Find lib and include files
50##############################################################################
51message(STATUS "Looking for libuuid")
Damjan Marion3648d932021-04-30 20:27:53 +020052vpp_find_path(UUID_INCLUDE_DIR NAMES uuid/uuid.h)
53vpp_find_library(UUID_LIB NAMES uuid)
Stephen Hemminger6fbef232018-10-15 12:52:30 -070054
55if(UUID_INCLUDE_DIR AND UUID_LIB)
56 include_directories(${UUID_INCLUDE_DIR})
57 set(VMBUS_SOURCE linux/vmbus.c)
58 set(VMBUS_LIBS uuid)
59 message(STATUS "Found uuid in ${UUID_INCLUDE_DIR}")
60else()
61 message(WARNING "-- libuuid not found - vmbus support disabled")
62endif()
63
64##############################################################################
Damjan Marion612dd6a2018-07-30 12:45:07 +020065# vlib shared library
66##############################################################################
Damjan Marion4553c952018-08-26 11:04:40 +020067add_vpp_library(vlib
68 SOURCES
Damjan Marion612dd6a2018-07-30 12:45:07 +020069 buffer.c
Damjan Marion1c229712021-04-21 12:55:15 +020070 buffer_funcs.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020071 cli.c
72 counter.c
Neale Ranns22e1f1d2019-03-01 15:53:11 +000073 drop.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020074 error.c
75 format.c
Dave Baracha638c182019-06-21 18:24:07 -040076 handoff_trace.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020077 init.c
78 linux/pci.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020079 linux/vfio.c
80 log.c
81 main.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020082 node.c
83 node_cli.c
84 node_format.c
Ray Kinsella4830e4f2020-03-10 14:35:32 +000085 node_init.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020086 pci/pci.c
Jakub Grajciar53f06a02020-03-30 08:12:57 +020087 pci/pci_types_api.c
Damjan Marion68b4da62018-09-30 18:26:20 +020088 physmem.c
Neale Ranns76b56492018-09-28 15:16:14 +000089 punt.c
90 punt_node.c
Damjan Marion8973b072022-03-01 15:51:18 +010091 stats/cli.c
92 stats/collector.c
93 stats/format.c
94 stats/init.c
95 stats/provider_mem.c
96 stats/stats.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020097 threads.c
98 threads_cli.c
Benoît Ganne56eccdb2021-08-20 09:18:31 +020099 time.c
Damjan Marion612dd6a2018-07-30 12:45:07 +0200100 trace.c
Damjan Marion612dd6a2018-07-30 12:45:07 +0200101 unix/cli.c
102 unix/input.c
103 unix/main.c
Damjan Marion612dd6a2018-07-30 12:45:07 +0200104 unix/plugin.c
105 unix/util.c
Stephen Hemminger6fbef232018-10-15 12:52:30 -0700106 vmbus/vmbus.c
107 ${VMBUS_SOURCE}
Marvin Liuabd56692022-08-17 09:38:40 +0800108 dma/dma.c
109 dma/cli.c
Damjan Marion612dd6a2018-07-30 12:45:07 +0200110
Neale Ranns22e1f1d2019-03-01 15:53:11 +0000111 MULTIARCH_SOURCES
Damjan Marion1c229712021-04-21 12:55:15 +0200112 buffer_funcs.c
Neale Ranns22e1f1d2019-03-01 15:53:11 +0000113 drop.c
Neale Ranns76b56492018-09-28 15:16:14 +0000114 punt_node.c
Ray Kinsella4830e4f2020-03-10 14:35:32 +0000115 node_init.c
Neale Ranns22e1f1d2019-03-01 15:53:11 +0000116
Damjan Marion4553c952018-08-26 11:04:40 +0200117 INSTALL_HEADERS
Damjan Marion612dd6a2018-07-30 12:45:07 +0200118 buffer_funcs.h
119 buffer.h
120 buffer_node.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200121 cli.h
122 counter.h
Ole Troan58492a82018-09-04 13:19:12 +0200123 counter_types.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200124 defs.h
Mohammed Hawari463d5f92023-01-17 12:18:15 +0100125 dma/dma.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200126 error_funcs.h
127 error.h
128 format_funcs.h
129 global_funcs.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200130 init.h
131 linux/vfio.h
132 log.h
133 main.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200134 node_funcs.h
135 node.h
136 pci/pci_config.h
137 pci/pci.h
Jakub Grajciar53f06a02020-03-30 08:12:57 +0200138 pci/pci_types_api.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200139 physmem_funcs.h
140 physmem.h
Neale Ranns76b56492018-09-28 15:16:14 +0000141 punt.h
Damjan Marion8973b072022-03-01 15:51:18 +0100142 stats/shared.h
143 stats/stats.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200144 threads.h
Benoît Ganne56eccdb2021-08-20 09:18:31 +0200145 time.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200146 trace_funcs.h
147 trace.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200148 unix/mc_socket.h
149 unix/plugin.h
150 unix/unix.h
151 vlib.h
Stephen Hemminger6fbef232018-10-15 12:52:30 -0700152 vmbus/vmbus.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200153
Jakub Grajciar53f06a02020-03-30 08:12:57 +0200154 API_FILES
155 pci/pci_types.api
156
Stephen Hemminger6fbef232018-10-15 12:52:30 -0700157 LINK_LIBRARIES vppinfra svm ${VMBUS_LIBS} ${CMAKE_DL_LIBS}
Jakub Grajciar53f06a02020-03-30 08:12:57 +0200158
159 DEPENDS api_headers
Damjan Marion4553c952018-08-26 11:04:40 +0200160)