vlib: deprecate i2c and cj
[vpp.git] / src / vlib / CMakeLists.txt
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
14 option(VPP_BUFFER_FAULT_INJECTOR "Include the buffer fault injector" OFF)
15
16 ##############################################################################
17 # Generate vlib/config.h
18 ##############################################################################
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
25 set(PRE_DATA_SIZE 128 CACHE STRING "Buffer headroom size.")
26 configure_file(
27   ${CMAKE_SOURCE_DIR}/vlib/config.h.in
28   ${CMAKE_BINARY_DIR}/vlib/config.h
29 )
30 install(
31   FILES ${CMAKE_BINARY_DIR}/vlib/config.h
32   DESTINATION include/vlib
33   COMPONENT vpp-dev
34 )
35
36 ##############################################################################
37 # Find lib and include files
38 ##############################################################################
39 message(STATUS "Looking for libuuid")
40 find_path(UUID_INCLUDE_DIR NAMES uuid/uuid.h)
41 find_library(UUID_LIB NAMES uuid)
42
43 if(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}")
48 else()
49   message(WARNING "-- libuuid not found - vmbus support disabled")
50 endif()
51
52 ##############################################################################
53 # vlib shared library
54 ##############################################################################
55 add_vpp_library(vlib
56   SOURCES
57   buffer.c
58   cli.c
59   counter.c
60   drop.c
61   error.c
62   format.c
63   handoff_trace.c
64   init.c
65   linux/pci.c
66   linux/vfio.c
67   log.c
68   main.c
69   node.c
70   node_cli.c
71   node_format.c
72   pci/pci.c
73   pci/pci_types_api.c
74   physmem.c
75   punt.c
76   punt_node.c
77   threads.c
78   threads_cli.c
79   trace.c
80   unix/cli.c
81   unix/input.c
82   unix/main.c
83   unix/plugin.c
84   unix/util.c
85   vmbus/vmbus.c
86   ${VMBUS_SOURCE}
87
88   MULTIARCH_SOURCES
89   drop.c
90   punt_node.c
91
92   INSTALL_HEADERS
93   buffer_funcs.h
94   buffer.h
95   buffer_node.h
96   cli.h
97   counter.h
98   counter_types.h
99   defs.h
100   error_funcs.h
101   error.h
102   format_funcs.h
103   global_funcs.h
104   init.h
105   linux/vfio.h
106   log.h
107   main.h
108   node_funcs.h
109   node.h
110   pci/pci_config.h
111   pci/pci.h
112   pci/pci_types_api.h
113   physmem_funcs.h
114   physmem.h
115   punt.h
116   threads.h
117   trace_funcs.h
118   trace.h
119   unix/mc_socket.h
120   unix/plugin.h
121   unix/unix.h
122   vlib.h
123   vmbus/vmbus.h
124
125   API_FILES
126   pci/pci_types.api
127
128   LINK_LIBRARIES vppinfra svm ${VMBUS_LIBS} ${CMAKE_DL_LIBS}
129
130   DEPENDS api_headers
131 )