diff options
Diffstat (limited to 'src/cmake/plugin.cmake')
-rw-r--r-- | src/cmake/plugin.cmake | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/cmake/plugin.cmake b/src/cmake/plugin.cmake index aca90ab7fb6..9b0383f583d 100644 --- a/src/cmake/plugin.cmake +++ b/src/cmake/plugin.cmake @@ -34,28 +34,29 @@ macro(add_vpp_plugin name) vpp_add_api_files(${plugin_name} plugins ${PLUGIN_COMPONENT} ${PLUGIN_API_FILES}) foreach(f ${PLUGIN_API_FILES}) get_filename_component(dir ${f} DIRECTORY) - list(APPEND api_includes ${f}.h ${f}.json) + list(APPEND api_includes ${f}.h ${f}_enum.h ${f}_types.h ${f}.json) install( - FILES ${CMAKE_CURRENT_BINARY_DIR}/${f}.h + FILES + ${CMAKE_CURRENT_BINARY_DIR}/${f}.h ${CMAKE_CURRENT_BINARY_DIR}/${f}_enum.h ${CMAKE_CURRENT_BINARY_DIR}/${f}_types.h DESTINATION include/vpp_plugins/${name}/${dir} COMPONENT ${PLUGIN_DEV_COMPONENT} ) endforeach() - add_library(${plugin_name} SHARED ${PLUGIN_SOURCES} ${api_includes}) + add_library(${plugin_name} SHARED ${api_includes} ${PLUGIN_SOURCES}) set_target_properties(${plugin_name} PROPERTIES NO_SONAME 1) target_compile_options(${plugin_name} PRIVATE "-fvisibility=hidden") target_compile_options (${plugin_name} PRIVATE "-ffunction-sections") target_compile_options (${plugin_name} PRIVATE "-fdata-sections") target_link_libraries (${plugin_name} "-Wl,--gc-sections") set(deps "") - if(PLUGIN_API_FILES) - list(APPEND deps ${plugin_name}_api_headers) - endif() if(NOT VPP_EXTERNAL_PROJECT) list(APPEND deps vpp_version_h api_headers) endif() + if(PLUGIN_API_FILES) + list(APPEND deps ${plugin_name}_api_headers) + endif() if(deps) add_dependencies(${plugin_name} ${deps}) endif() @@ -63,7 +64,7 @@ macro(add_vpp_plugin name) PREFIX "" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/vpp_plugins) if(PLUGIN_MULTIARCH_SOURCES) - vpp_library_set_multiarch_sources(${plugin_name} "${deps}" ${PLUGIN_MULTIARCH_SOURCES}) + vpp_library_set_multiarch_sources(${plugin_name} SOURCES ${PLUGIN_MULTIARCH_SOURCES} DEPENDS ${deps}) endif() if(PLUGIN_LINK_LIBRARIES) target_link_libraries(${plugin_name} ${PLUGIN_LINK_LIBRARIES}) @@ -86,12 +87,12 @@ macro(add_vpp_plugin name) add_library(${test_plugin_name} SHARED ${PLUGIN_API_TEST_SOURCES} ${api_includes}) set_target_properties(${test_plugin_name} PROPERTIES NO_SONAME 1) - if(PLUGIN_API_FILES) - add_dependencies(${test_plugin_name} ${plugin_name}_api_headers) - endif() if(NOT VPP_EXTERNAL_PROJECT) add_dependencies(${test_plugin_name} api_headers) endif() + if(PLUGIN_API_FILES) + add_dependencies(${test_plugin_name} ${plugin_name}_api_headers) + endif() set_target_properties(${test_plugin_name} PROPERTIES PREFIX "" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/vpp_api_test_plugins) |