blob: 2846128ce9360a3214d3119de6b67cd0694a5686 [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.")
26configure_file(
27 ${CMAKE_SOURCE_DIR}/vlib/config.h.in
28 ${CMAKE_BINARY_DIR}/vlib/config.h
29)
Damjan Marion833de8c2018-09-07 12:39:02 +020030install(
31 FILES ${CMAKE_BINARY_DIR}/vlib/config.h
32 DESTINATION include/vlib
33 COMPONENT vpp-dev
34)
Damjan Marion612dd6a2018-07-30 12:45:07 +020035
36##############################################################################
Stephen Hemminger6fbef232018-10-15 12:52:30 -070037# Find lib and include files
38##############################################################################
39message(STATUS "Looking for libuuid")
40find_path(UUID_INCLUDE_DIR NAMES uuid/uuid.h)
41find_library(UUID_LIB NAMES uuid)
42
43if(UUID_INCLUDE_DIR AND UUID_LIB)
44 include_directories(${UUID_INCLUDE_DIR})
45 set(VMBUS_SOURCE linux/vmbus.c)
46 set(VMBUS_LIBS uuid)
47 message(STATUS "Found uuid in ${UUID_INCLUDE_DIR}")
48else()
49 message(WARNING "-- libuuid not found - vmbus support disabled")
50endif()
51
52##############################################################################
Damjan Marion612dd6a2018-07-30 12:45:07 +020053# vlib shared library
54##############################################################################
Damjan Marion4553c952018-08-26 11:04:40 +020055add_vpp_library(vlib
56 SOURCES
Damjan Marion612dd6a2018-07-30 12:45:07 +020057 buffer.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020058 cli.c
59 counter.c
Neale Ranns22e1f1d2019-03-01 15:53:11 +000060 drop.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020061 error.c
62 format.c
Dave Baracha638c182019-06-21 18:24:07 -040063 handoff_trace.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020064 init.c
65 linux/pci.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020066 linux/vfio.c
67 log.c
68 main.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020069 node.c
70 node_cli.c
71 node_format.c
Ray Kinsella4830e4f2020-03-10 14:35:32 +000072 node_init.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020073 pci/pci.c
Jakub Grajciar53f06a02020-03-30 08:12:57 +020074 pci/pci_types_api.c
Damjan Marion68b4da62018-09-30 18:26:20 +020075 physmem.c
Neale Ranns76b56492018-09-28 15:16:14 +000076 punt.c
77 punt_node.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020078 threads.c
79 threads_cli.c
80 trace.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020081 unix/cli.c
82 unix/input.c
83 unix/main.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020084 unix/plugin.c
85 unix/util.c
Stephen Hemminger6fbef232018-10-15 12:52:30 -070086 vmbus/vmbus.c
87 ${VMBUS_SOURCE}
Damjan Marion612dd6a2018-07-30 12:45:07 +020088
Neale Ranns22e1f1d2019-03-01 15:53:11 +000089 MULTIARCH_SOURCES
90 drop.c
Neale Ranns76b56492018-09-28 15:16:14 +000091 punt_node.c
Ray Kinsella4830e4f2020-03-10 14:35:32 +000092 node_init.c
Neale Ranns22e1f1d2019-03-01 15:53:11 +000093
Damjan Marion4553c952018-08-26 11:04:40 +020094 INSTALL_HEADERS
Damjan Marion612dd6a2018-07-30 12:45:07 +020095 buffer_funcs.h
96 buffer.h
97 buffer_node.h
Damjan Marion612dd6a2018-07-30 12:45:07 +020098 cli.h
99 counter.h
Ole Troan58492a82018-09-04 13:19:12 +0200100 counter_types.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200101 defs.h
102 error_funcs.h
103 error.h
104 format_funcs.h
105 global_funcs.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200106 init.h
107 linux/vfio.h
108 log.h
109 main.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200110 node_funcs.h
111 node.h
112 pci/pci_config.h
113 pci/pci.h
Jakub Grajciar53f06a02020-03-30 08:12:57 +0200114 pci/pci_types_api.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200115 physmem_funcs.h
116 physmem.h
Neale Ranns76b56492018-09-28 15:16:14 +0000117 punt.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200118 threads.h
119 trace_funcs.h
120 trace.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200121 unix/mc_socket.h
122 unix/plugin.h
123 unix/unix.h
124 vlib.h
Stephen Hemminger6fbef232018-10-15 12:52:30 -0700125 vmbus/vmbus.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200126
Jakub Grajciar53f06a02020-03-30 08:12:57 +0200127 API_FILES
128 pci/pci_types.api
129
Stephen Hemminger6fbef232018-10-15 12:52:30 -0700130 LINK_LIBRARIES vppinfra svm ${VMBUS_LIBS} ${CMAKE_DL_LIBS}
Jakub Grajciar53f06a02020-03-30 08:12:57 +0200131
132 DEPENDS api_headers
Damjan Marion4553c952018-08-26 11:04:40 +0200133)