aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmake/plugin.cmake
diff options
context:
space:
mode:
authorAloys Augustin <aloaugus@cisco.com>2020-10-13 15:43:00 +0200
committerDamjan Marion <dmarion@me.com>2020-10-15 19:41:45 +0000
commit2a65804259e8c139c2d556f1c3e95f435280b4d2 (patch)
treecc2e61c0fc36adf7ca9f19b9faff0f020fff4758 /src/cmake/plugin.cmake
parent7286943e7efdbbf99abd8bf318547b2402a4966d (diff)
build: forward dependencies to arch-specific libs
Without this, if a multiarch source depends on a generated api header for instance, the build would be racy between the api header generation and the multiarch object compilation. Type: improvement Signed-off-by: Aloys Augustin <aloaugus@cisco.com> Change-Id: I08fcd0e5a1c51398ac1a8f37cf6562064b400d4a
Diffstat (limited to 'src/cmake/plugin.cmake')
-rw-r--r--src/cmake/plugin.cmake8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/cmake/plugin.cmake b/src/cmake/plugin.cmake
index c37e349477e..1bcff5559ff 100644
--- a/src/cmake/plugin.cmake
+++ b/src/cmake/plugin.cmake
@@ -45,17 +45,19 @@ macro(add_vpp_plugin name)
endforeach()
add_library(${plugin_name} SHARED ${PLUGIN_SOURCES} ${api_includes})
set_target_properties(${plugin_name} PROPERTIES NO_SONAME 1)
+ set(deps "")
if(PLUGIN_API_FILES)
- add_dependencies(${plugin_name} ${plugin_name}_api_headers)
+ list(APPEND deps ${plugin_name}_api_headers)
endif()
if(NOT VPP_EXTERNAL_PROJECT)
- add_dependencies(${plugin_name} vpp_version_h api_headers)
+ list(APPEND deps vpp_version_h api_headers)
endif()
+ add_dependencies(${plugin_name} ${deps})
set_target_properties(${plugin_name} PROPERTIES
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/vpp_plugins)
if(PLUGIN_MULTIARCH_SOURCES)
- vpp_library_set_multiarch_sources(${plugin_name} ${PLUGIN_MULTIARCH_SOURCES})
+ vpp_library_set_multiarch_sources(${plugin_name} "${deps}" ${PLUGIN_MULTIARCH_SOURCES})
endif()
if(PLUGIN_LINK_LIBRARIES)
target_link_libraries(${plugin_name} ${PLUGIN_LINK_LIBRARIES})