aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmake/cpu.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/cpu.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/cpu.cmake')
-rw-r--r--src/cmake/cpu.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cmake/cpu.cmake b/src/cmake/cpu.cmake
index c7ad1a4a0bc..37bc24c09b5 100644
--- a/src/cmake/cpu.cmake
+++ b/src/cmake/cpu.cmake
@@ -121,12 +121,15 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*)")
endif()
endif()
-macro(vpp_library_set_multiarch_sources lib)
+macro(vpp_library_set_multiarch_sources lib deps)
foreach(V ${MARCH_VARIANTS})
list(GET V 0 VARIANT)
list(GET V 1 VARIANT_FLAGS)
set(l ${lib}_${VARIANT})
add_library(${l} OBJECT ${ARGN})
+ if("${deps}")
+ add_dependencies(${l} ${deps})
+ endif()
set_target_properties(${l} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_compile_options(${l} PUBLIC "-DCLIB_MARCH_VARIANT=${VARIANT}")
separate_arguments(VARIANT_FLAGS)