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 6)
20 option(VPP_USE_DLMALLOC "Use dlmalloc memory allocator." ON)
23 else(VPP_USE_DLMALLOC)
25 endif(VPP_USE_DLMALLOC)
28 ${CMAKE_SOURCE_DIR}/vppinfra/config.h.in
29 ${CMAKE_BINARY_DIR}/vppinfra/config.h
33 FILES ${CMAKE_BINARY_DIR}/vppinfra/config.h
34 DESTINATION include/vppinfra
38 ##############################################################################
40 ##############################################################################
75 tw_timer_2t_1w_2048sl.c
76 tw_timer_16t_2w_512sl.c
77 tw_timer_16t_1w_2048sl.c
78 tw_timer_4t_3w_256sl.c
79 tw_timer_1t_3w_1024sl_ov.c
92 list(APPEND VPPINFRA_SRCS
96 else(VPP_USE_DLMALLOC)
97 list(APPEND VPPINFRA_SRCS
101 endif(VPP_USE_DLMALLOC)
103 add_library(vppinfra SHARED ${VPPINFRA_SRCS})
104 target_link_libraries(vppinfra m)
105 install(TARGETS vppinfra DESTINATION lib)
107 ##############################################################################
109 ##############################################################################
110 vpp_add_header_files(vppinfra
176 tw_timer_16t_1w_2048sl.h
177 tw_timer_16t_2w_512sl.h
178 tw_timer_1t_3w_1024sl_ov.h
179 tw_timer_2t_1w_2048sl.h
180 tw_timer_4t_3w_256sl.h
203 option(VPP_BUILD_VPPINFRA_TESTS "Build vppinfra tests." OFF)
204 if(VPP_BUILD_VPPINFRA_TESTS)
238 foreach(test ${VPPINFRA_TESTS})
239 add_executable(test_${test} test_${test}.c)
240 target_link_libraries(test_${test} vppinfra)
243 target_link_libraries(test_bihash_template Threads::Threads)
244 target_link_libraries(test_cuckoo_bihash Threads::Threads)
245 endif(VPP_BUILD_VPPINFRA_TESTS)