misc: support api generated dependency for multiarch source

Fix dependency issues where multi-arch file is using API generated file.

Type: improvement
Change-Id: I5d4af7a630529bc138c35841723e38938f36d963
Signed-off-by: Ole Troan <ot@cisco.com>
diff --git a/src/cmake/library.cmake b/src/cmake/library.cmake
index 3f17e30..fdd3469 100644
--- a/src/cmake/library.cmake
+++ b/src/cmake/library.cmake
@@ -46,7 +46,7 @@
   endif()
 
   if(ARG_MULTIARCH_SOURCES)
-    vpp_library_set_multiarch_sources(${lib} "${ARG_DEPENDS}" ${ARG_MULTIARCH_SOURCES})
+    vpp_library_set_multiarch_sources(${lib} DEPENDS ${ARG_DEPENDS} SOURCES ${ARG_MULTIARCH_SOURCES})
   endif()
 
   if(ARG_API_FILES)
@@ -65,6 +65,10 @@
     endforeach()
   endif()
 
+  if(NOT VPP_EXTERNAL_PROJECT)
+    add_dependencies(${lib} api_headers)
+  endif()
+
   if(ARG_DEPENDS)
     add_dependencies(${lib} ${ARG_DEPENDS})
   endif()