vlib: remove dependency on libuuid
[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
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
38 configure_file(
39   ${CMAKE_SOURCE_DIR}/vlib/config.h.in
40   ${CMAKE_CURRENT_BINARY_DIR}/config.h
41 )
42 install(
43   FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h
44   DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/vlib
45   COMPONENT vpp-dev
46 )
47
48 ##############################################################################
49 # vlib shared library
50 ##############################################################################
51 add_vpp_library(vlib
52   SOURCES
53   buffer.c
54   buffer_funcs.c
55   cli.c
56   counter.c
57   drop.c
58   error.c
59   format.c
60   handoff_trace.c
61   init.c
62   linux/pci.c
63   linux/vfio.c
64   linux/vmbus.c
65   log.c
66   main.c
67   node.c
68   node_cli.c
69   node_format.c
70   node_init.c
71   pci/pci.c
72   pci/pci_types_api.c
73   physmem.c
74   punt.c
75   punt_node.c
76   stats/cli.c
77   stats/collector.c
78   stats/format.c
79   stats/init.c
80   stats/provider_mem.c
81   stats/stats.c
82   threads.c
83   threads_cli.c
84   time.c
85   trace.c
86   unix/cli.c
87   unix/input.c
88   unix/main.c
89   unix/plugin.c
90   unix/util.c
91   vmbus/vmbus.c
92   dma/dma.c
93   dma/cli.c
94
95   MULTIARCH_SOURCES
96   buffer_funcs.c
97   drop.c
98   punt_node.c
99   node_init.c
100
101   INSTALL_HEADERS
102   buffer_funcs.h
103   buffer.h
104   buffer_node.h
105   cli.h
106   counter.h
107   counter_types.h
108   defs.h
109   dma/dma.h
110   error_funcs.h
111   error.h
112   format_funcs.h
113   global_funcs.h
114   init.h
115   linux/vfio.h
116   log.h
117   main.h
118   node_funcs.h
119   node.h
120   pci/pci_config.h
121   pci/pci.h
122   pci/pci_types_api.h
123   physmem_funcs.h
124   physmem.h
125   punt.h
126   stats/shared.h
127   stats/stats.h
128   threads.h
129   time.h
130   trace_funcs.h
131   trace.h
132   unix/mc_socket.h
133   unix/plugin.h
134   unix/unix.h
135   vlib.h
136   vmbus/vmbus.h
137
138   API_FILES
139   pci/pci_types.api
140
141   LINK_LIBRARIES vppinfra svm ${CMAKE_DL_LIBS}
142
143   DEPENDS api_headers
144 )