aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmake')
-rw-r--r--src/cmake/library.cmake30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/cmake/library.cmake b/src/cmake/library.cmake
index d19eb3c80cc..c80d7f226d6 100644
--- a/src/cmake/library.cmake
+++ b/src/cmake/library.cmake
@@ -108,6 +108,36 @@ function (add_vpp_headers path)
endforeach()
endfunction()
+macro(add_vat_test_library lib)
+ cmake_parse_arguments(TEST
+ ""
+ ""
+ ${ARGN}
+ )
+
+ foreach(file ${ARGN})
+ get_filename_component(name ${file} NAME_WE)
+ set(test_lib ${lib}_${name}_plugin)
+ add_library(${test_lib} SHARED ${file})
+ target_compile_options(${test_lib} PUBLIC ${VPP_DEFAULT_MARCH_FLAGS})
+ if(NOT VPP_EXTERNAL_PROJECT)
+ add_dependencies(${test_lib} api_headers)
+ endif()
+ include_directories(${CMAKE_CURRENT_BINARY_DIR})
+ set_target_properties(${test_lib} PROPERTIES NO_SONAME 1)
+ set_target_properties(${test_lib} PROPERTIES
+ PREFIX ""
+ LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/vpp_api_test_plugins)
+
+ # install .so
+ install(
+ TARGETS ${test_lib}
+ DESTINATION ${VPP_LIBRARY_DIR}/vpp_api_test_plugins
+ COMPONENT ${ARG_COMPONENT}
+ )
+ endforeach()
+endmacro()
+
macro(add_vpp_test_library lib)
cmake_parse_arguments(TEST
""