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 | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 25 | set(PRE_DATA_SIZE 128 CACHE STRING "Buffer headroom size.") |
Damjan Marion | ef58758 | 2020-05-20 22:01:44 +0200 | [diff] [blame] | 26 | |
| 27 | if (CMAKE_BUILD_TYPE_UC STREQUAL "DEBUG") |
| 28 | set(_ss 16) |
| 29 | else() |
| 30 | set(_ss 15) |
| 31 | endif() |
| 32 | set(VLIB_PROCESS_LOG2_STACK_SIZE |
| 33 | ${_ss} |
| 34 | CACHE |
| 35 | STRING "Process node default stack size (log2)" |
| 36 | ) |
| 37 | |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 38 | configure_file( |
| 39 | ${CMAKE_SOURCE_DIR}/vlib/config.h.in |
Damjan Marion | 88b2e36 | 2021-04-29 18:47:25 +0200 | [diff] [blame] | 40 | ${CMAKE_CURRENT_BINARY_DIR}/config.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 41 | ) |
Damjan Marion | 833de8c | 2018-09-07 12:39:02 +0200 | [diff] [blame] | 42 | install( |
Damjan Marion | 88b2e36 | 2021-04-29 18:47:25 +0200 | [diff] [blame] | 43 | FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h |
Nick Brown | e3cf4d0 | 2021-09-15 14:25:40 +0100 | [diff] [blame] | 44 | DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/vlib |
Damjan Marion | 833de8c | 2018-09-07 12:39:02 +0200 | [diff] [blame] | 45 | COMPONENT vpp-dev |
| 46 | ) |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 47 | |
| 48 | ############################################################################## |
Stephen Hemminger | 6fbef23 | 2018-10-15 12:52:30 -0700 | [diff] [blame] | 49 | # Find lib and include files |
| 50 | ############################################################################## |
| 51 | message(STATUS "Looking for libuuid") |
Damjan Marion | 3648d93 | 2021-04-30 20:27:53 +0200 | [diff] [blame] | 52 | vpp_find_path(UUID_INCLUDE_DIR NAMES uuid/uuid.h) |
| 53 | vpp_find_library(UUID_LIB NAMES uuid) |
Stephen Hemminger | 6fbef23 | 2018-10-15 12:52:30 -0700 | [diff] [blame] | 54 | |
| 55 | if(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}") |
| 60 | else() |
| 61 | message(WARNING "-- libuuid not found - vmbus support disabled") |
| 62 | endif() |
| 63 | |
| 64 | ############################################################################## |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 65 | # vlib shared library |
| 66 | ############################################################################## |
Damjan Marion | 4553c95 | 2018-08-26 11:04:40 +0200 | [diff] [blame] | 67 | add_vpp_library(vlib |
| 68 | SOURCES |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 69 | buffer.c |
Damjan Marion | 1c22971 | 2021-04-21 12:55:15 +0200 | [diff] [blame] | 70 | buffer_funcs.c |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 71 | cli.c |
| 72 | counter.c |
Neale Ranns | 22e1f1d | 2019-03-01 15:53:11 +0000 | [diff] [blame] | 73 | drop.c |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 74 | error.c |
| 75 | format.c |
Dave Barach | a638c18 | 2019-06-21 18:24:07 -0400 | [diff] [blame] | 76 | handoff_trace.c |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 77 | init.c |
| 78 | linux/pci.c |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 79 | linux/vfio.c |
| 80 | log.c |
| 81 | main.c |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 82 | node.c |
| 83 | node_cli.c |
| 84 | node_format.c |
Ray Kinsella | 4830e4f | 2020-03-10 14:35:32 +0000 | [diff] [blame] | 85 | node_init.c |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 86 | pci/pci.c |
Jakub Grajciar | 53f06a0 | 2020-03-30 08:12:57 +0200 | [diff] [blame] | 87 | pci/pci_types_api.c |
Damjan Marion | 68b4da6 | 2018-09-30 18:26:20 +0200 | [diff] [blame] | 88 | physmem.c |
Neale Ranns | 76b5649 | 2018-09-28 15:16:14 +0000 | [diff] [blame] | 89 | punt.c |
| 90 | punt_node.c |
Damjan Marion | 8973b07 | 2022-03-01 15:51:18 +0100 | [diff] [blame] | 91 | 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 Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 97 | threads.c |
| 98 | threads_cli.c |
Benoît Ganne | 56eccdb | 2021-08-20 09:18:31 +0200 | [diff] [blame] | 99 | time.c |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 100 | trace.c |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 101 | unix/cli.c |
| 102 | unix/input.c |
| 103 | unix/main.c |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 104 | unix/plugin.c |
| 105 | unix/util.c |
Stephen Hemminger | 6fbef23 | 2018-10-15 12:52:30 -0700 | [diff] [blame] | 106 | vmbus/vmbus.c |
| 107 | ${VMBUS_SOURCE} |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 108 | |
Neale Ranns | 22e1f1d | 2019-03-01 15:53:11 +0000 | [diff] [blame] | 109 | MULTIARCH_SOURCES |
Damjan Marion | 1c22971 | 2021-04-21 12:55:15 +0200 | [diff] [blame] | 110 | buffer_funcs.c |
Neale Ranns | 22e1f1d | 2019-03-01 15:53:11 +0000 | [diff] [blame] | 111 | drop.c |
Neale Ranns | 76b5649 | 2018-09-28 15:16:14 +0000 | [diff] [blame] | 112 | punt_node.c |
Ray Kinsella | 4830e4f | 2020-03-10 14:35:32 +0000 | [diff] [blame] | 113 | node_init.c |
Neale Ranns | 22e1f1d | 2019-03-01 15:53:11 +0000 | [diff] [blame] | 114 | |
Damjan Marion | 4553c95 | 2018-08-26 11:04:40 +0200 | [diff] [blame] | 115 | INSTALL_HEADERS |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 116 | buffer_funcs.h |
| 117 | buffer.h |
| 118 | buffer_node.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 119 | cli.h |
| 120 | counter.h |
Ole Troan | 58492a8 | 2018-09-04 13:19:12 +0200 | [diff] [blame] | 121 | counter_types.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 122 | defs.h |
| 123 | error_funcs.h |
| 124 | error.h |
| 125 | format_funcs.h |
| 126 | global_funcs.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 127 | init.h |
| 128 | linux/vfio.h |
| 129 | log.h |
| 130 | main.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 131 | node_funcs.h |
| 132 | node.h |
| 133 | pci/pci_config.h |
| 134 | pci/pci.h |
Jakub Grajciar | 53f06a0 | 2020-03-30 08:12:57 +0200 | [diff] [blame] | 135 | pci/pci_types_api.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 136 | physmem_funcs.h |
| 137 | physmem.h |
Neale Ranns | 76b5649 | 2018-09-28 15:16:14 +0000 | [diff] [blame] | 138 | punt.h |
Damjan Marion | 8973b07 | 2022-03-01 15:51:18 +0100 | [diff] [blame] | 139 | stats/shared.h |
| 140 | stats/stats.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 141 | threads.h |
Benoît Ganne | 56eccdb | 2021-08-20 09:18:31 +0200 | [diff] [blame] | 142 | time.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 143 | trace_funcs.h |
| 144 | trace.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 145 | unix/mc_socket.h |
| 146 | unix/plugin.h |
| 147 | unix/unix.h |
| 148 | vlib.h |
Stephen Hemminger | 6fbef23 | 2018-10-15 12:52:30 -0700 | [diff] [blame] | 149 | vmbus/vmbus.h |
Damjan Marion | 612dd6a | 2018-07-30 12:45:07 +0200 | [diff] [blame] | 150 | |
Jakub Grajciar | 53f06a0 | 2020-03-30 08:12:57 +0200 | [diff] [blame] | 151 | API_FILES |
| 152 | pci/pci_types.api |
| 153 | |
Stephen Hemminger | 6fbef23 | 2018-10-15 12:52:30 -0700 | [diff] [blame] | 154 | LINK_LIBRARIES vppinfra svm ${VMBUS_LIBS} ${CMAKE_DL_LIBS} |
Jakub Grajciar | 53f06a0 | 2020-03-30 08:12:57 +0200 | [diff] [blame] | 155 | |
| 156 | DEPENDS api_headers |
Damjan Marion | 4553c95 | 2018-08-26 11:04:40 +0200 | [diff] [blame] | 157 | ) |