summaryrefslogtreecommitdiffstats
path: root/src/cmake/cpu.cmake
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2020-12-02 14:19:49 +0100
committerNeale Ranns <neale@graphiant.com>2021-02-08 11:41:12 +0000
commit7d527a2292bdabc84ff070f5b27f35c0e858cddd (patch)
tree4aee489caedb05eaf24ccb03d05f0fe5c383eb64 /src/cmake/cpu.cmake
parente5b7ca4bcea8c404d95e00f5db4c40d47b6e185b (diff)
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>
Diffstat (limited to 'src/cmake/cpu.cmake')
-rw-r--r--src/cmake/cpu.cmake15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/cmake/cpu.cmake b/src/cmake/cpu.cmake
index b3f9f0e4330..623c9ded88e 100644
--- a/src/cmake/cpu.cmake
+++ b/src/cmake/cpu.cmake
@@ -125,14 +125,21 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*)")
endif()
endif()
-macro(vpp_library_set_multiarch_sources lib deps)
+macro(vpp_library_set_multiarch_sources lib)
+ cmake_parse_arguments(ARG
+ ""
+ ""
+ "SOURCES;DEPENDS"
+ ${ARGN}
+ )
+
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})
+ add_library(${l} OBJECT ${ARG_SOURCES})
+ if(ARG_DEPENDS)
+ add_dependencies(${l} ${ARG_DEPENDS})
endif()
set_target_properties(${l} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_compile_options(${l} PUBLIC "-DCLIB_MARCH_VARIANT=${VARIANT}")