blob: 86fc965ba97d0bd0355556e96c8cf712a4ea0c60 [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
14##############################################################################
15# Generate vlib/config.h
16##############################################################################
17set(PRE_DATA_SIZE 128 CACHE STRING "Buffer headroom size.")
18configure_file(
19 ${CMAKE_SOURCE_DIR}/vlib/config.h.in
20 ${CMAKE_BINARY_DIR}/vlib/config.h
21)
Damjan Marion833de8c2018-09-07 12:39:02 +020022install(
23 FILES ${CMAKE_BINARY_DIR}/vlib/config.h
24 DESTINATION include/vlib
25 COMPONENT vpp-dev
26)
Damjan Marion612dd6a2018-07-30 12:45:07 +020027
28##############################################################################
Stephen Hemminger6fbef232018-10-15 12:52:30 -070029# Find lib and include files
30##############################################################################
31message(STATUS "Looking for libuuid")
32find_path(UUID_INCLUDE_DIR NAMES uuid/uuid.h)
33find_library(UUID_LIB NAMES uuid)
34
35if(UUID_INCLUDE_DIR AND UUID_LIB)
36 include_directories(${UUID_INCLUDE_DIR})
37 set(VMBUS_SOURCE linux/vmbus.c)
38 set(VMBUS_LIBS uuid)
39 message(STATUS "Found uuid in ${UUID_INCLUDE_DIR}")
40else()
41 message(WARNING "-- libuuid not found - vmbus support disabled")
42endif()
43
44##############################################################################
Damjan Marion612dd6a2018-07-30 12:45:07 +020045# vlib shared library
46##############################################################################
Damjan Marion4553c952018-08-26 11:04:40 +020047add_vpp_library(vlib
48 SOURCES
Damjan Marion612dd6a2018-07-30 12:45:07 +020049 buffer.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020050 cli.c
51 counter.c
52 error.c
53 format.c
54 i2c.c
55 init.c
56 linux/pci.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020057 linux/vfio.c
58 log.c
59 main.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020060 node.c
61 node_cli.c
62 node_format.c
63 pci/pci.c
Damjan Marion68b4da62018-09-30 18:26:20 +020064 physmem.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020065 threads.c
66 threads_cli.c
67 trace.c
68 unix/cj.c
69 unix/cli.c
70 unix/input.c
71 unix/main.c
Damjan Marion612dd6a2018-07-30 12:45:07 +020072 unix/plugin.c
73 unix/util.c
Stephen Hemminger6fbef232018-10-15 12:52:30 -070074 vmbus/vmbus.c
75 ${VMBUS_SOURCE}
Damjan Marion612dd6a2018-07-30 12:45:07 +020076
Damjan Marion4553c952018-08-26 11:04:40 +020077 INSTALL_HEADERS
Damjan Marion612dd6a2018-07-30 12:45:07 +020078 buffer_funcs.h
79 buffer.h
80 buffer_node.h
81 cli_funcs.h
82 cli.h
83 counter.h
Ole Troan58492a82018-09-04 13:19:12 +020084 counter_types.h
Damjan Marion612dd6a2018-07-30 12:45:07 +020085 defs.h
86 error_funcs.h
87 error.h
88 format_funcs.h
89 global_funcs.h
90 i2c.h
91 init.h
92 linux/vfio.h
93 log.h
94 main.h
Damjan Marion612dd6a2018-07-30 12:45:07 +020095 node_funcs.h
96 node.h
97 pci/pci_config.h
98 pci/pci.h
99 physmem_funcs.h
100 physmem.h
101 threads.h
102 trace_funcs.h
103 trace.h
104 unix/cj.h
105 unix/mc_socket.h
106 unix/plugin.h
107 unix/unix.h
108 vlib.h
Stephen Hemminger6fbef232018-10-15 12:52:30 -0700109 vmbus/vmbus.h
Damjan Marion612dd6a2018-07-30 12:45:07 +0200110
Stephen Hemminger6fbef232018-10-15 12:52:30 -0700111 LINK_LIBRARIES vppinfra svm ${VMBUS_LIBS} ${CMAKE_DL_LIBS}
Damjan Marion4553c952018-08-26 11:04:40 +0200112)