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:
6 # http://www.apache.org/licenses/LICENSE-2.0
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.
16 ##############################################################################
17 # Generate vppinfra/config.h
18 ##############################################################################
19 set(LOG2_CACHE_LINE_BYTES ${VPP_LOG2_CACHE_LINE_SIZE})
21 option(VPP_VECTOR_GROW_BY_ONE "Vectors grow by one, instead of 3/2" OFF)
22 if(VPP_VECTOR_GROW_BY_ONE)
23 set(VECTOR_GROW_BY_ONE 1)
24 else(VPP_VECTOR_GROW_BY_ONE)
25 set(VECTOR_GROW_BY_ONE 0)
26 endif(VPP_VECTOR_GROW_BY_ONE)
29 ${CMAKE_SOURCE_DIR}/vppinfra/config.h.in
30 ${CMAKE_BINARY_DIR}/vppinfra/config.h
34 FILES ${CMAKE_BINARY_DIR}/vppinfra/config.h
35 DESTINATION include/vppinfra
39 ##############################################################################
41 ##############################################################################
76 tw_timer_2t_2w_512sl.c
77 tw_timer_16t_1w_2048sl.c
78 tw_timer_16t_2w_512sl.c
79 tw_timer_1t_3w_1024sl_ov.c
80 tw_timer_2t_1w_2048sl.c
81 tw_timer_4t_3w_256sl.c
156 tw_timer_2t_2w_512sl.h
157 tw_timer_16t_1w_2048sl.h
158 tw_timer_16t_2w_512sl.h
159 tw_timer_1t_3w_1024sl_ov.h
160 tw_timer_2t_1w_2048sl.h
161 tw_timer_4t_3w_256sl.h
183 if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
184 list(APPEND VPPINFRA_SRCS
191 add_vpp_library(vppinfra
192 SOURCES ${VPPINFRA_SRCS}
194 INSTALL_HEADERS ${VPPINFRA_HEADERS}
195 COMPONENT libvppinfra
198 ##############################################################################
200 ##############################################################################
201 option(VPP_BUILD_VPPINFRA_TESTS "Build vppinfra tests." OFF)
202 if(VPP_BUILD_VPPINFRA_TESTS)
231 add_vpp_executable(test_${test}
232 SOURCES test_${test}.c
233 LINK_LIBRARIES vppinfra pthread
237 foreach(test bihash_template)
238 add_vpp_executable(test_${test}
239 SOURCES test_${test}.c
240 LINK_LIBRARIES vppinfra Threads::Threads
243 endif(VPP_BUILD_VPPINFRA_TESTS)