aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmake/plugin.cmake
diff options
context:
space:
mode:
authorOliver Giles <oliver_g@radwin.com>2019-12-05 23:37:36 +0200
committerDamjan Marion <dmarion@me.com>2019-12-17 18:05:15 +0000
commitdc20371f83ed81462c0b24eb750b76f7819df64a (patch)
tree01eb5b83c0be944987f9cbd4777877c03f6bc36f /src/cmake/plugin.cmake
parent3d14f036199d9b3098268821424b4e6f5e8f46dc (diff)
build: export vapi generation in vpp-dev
Adds the higher-level vapi generation to cmake/api.cmake and exposes the necessary python scripts in vpp-dev, so that out-of-tree/downstream plugins can also leverage the more convenient API. Type: feature Signed-off-by: Oliver Giles <oliver_g@radwin.com> Change-Id: I8c40a14d27ba3cb972c6907632e03c0e7b0ce982
Diffstat (limited to 'src/cmake/plugin.cmake')
-rw-r--r--src/cmake/plugin.cmake7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/cmake/plugin.cmake b/src/cmake/plugin.cmake
index a0c3de78f3c..2e2749a440e 100644
--- a/src/cmake/plugin.cmake
+++ b/src/cmake/plugin.cmake
@@ -31,12 +31,10 @@ macro(add_vpp_plugin name)
endif()
endif()
- file(RELATIVE_PATH rpath ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
+ vpp_add_api_files(${plugin_name} plugins ${PLUGIN_COMPONENT} ${PLUGIN_API_FILES})
foreach(f ${PLUGIN_API_FILES})
get_filename_component(dir ${f} DIRECTORY)
- vpp_generate_api_header(${f} plugins ${PLUGIN_COMPONENT})
list(APPEND api_includes ${f}.h ${f}.json)
- set_property(GLOBAL APPEND PROPERTY VPP_API_FILES ${rpath}/${f})
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${f}.h
${CMAKE_CURRENT_BINARY_DIR}/${f}_enum.h
@@ -47,6 +45,9 @@ macro(add_vpp_plugin name)
endforeach()
add_library(${plugin_name} SHARED ${PLUGIN_SOURCES} ${api_includes})
set_target_properties(${plugin_name} PROPERTIES NO_SONAME 1)
+ if(PLUGIN_API_FILES)
+ add_dependencies(${plugin_name} ${plugin_name}_api_headers)
+ endif()
if(NOT VPP_EXTERNAL_PROJECT)
add_dependencies(${plugin_name} vpp_version_h api_headers)
endif()