diff options
author | Damjan Marion <damarion@cisco.com> | 2021-05-06 20:48:34 +0200 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2021-05-06 21:40:39 +0000 |
commit | 312fb4dbdf20e9d9ff47ccbcaaabba22ea7d20a4 (patch) | |
tree | 0d994fd6c0a71151c803a0d4e11af3b597d50aaa /src/cmake/cpu.cmake | |
parent | f4d338f0b44e28d9ad5b446422caf15fd871c8cd (diff) |
build: add FORCE_ON option for multiarch variants
Type: make
Change-Id: I37fb925a9cc2dfc21dd7874f4b20a6943b28efc8
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/cmake/cpu.cmake')
-rw-r--r-- | src/cmake/cpu.cmake | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/cmake/cpu.cmake b/src/cmake/cpu.cmake index caeccc050cf..539f7c803a9 100644 --- a/src/cmake/cpu.cmake +++ b/src/cmake/cpu.cmake @@ -107,6 +107,8 @@ macro(add_vpp_march_variant v) endif() if (VPP_MARCH_VARIANT_${uv}) list(APPEND MARCH_VARIANTS "${v}\;${fs}") + else() + list(APPEND MARCH_VARIANTS_DISABLED "${v}\;${fs}") endif() endif() endif() @@ -169,11 +171,25 @@ macro(vpp_library_set_multiarch_sources lib) cmake_parse_arguments(ARG "" "" - "SOURCES;DEPENDS" + "SOURCES;DEPENDS;FORCE_ON" ${ARGN} ) - foreach(V ${MARCH_VARIANTS}) + set(VARIANTS "${MARCH_VARIANTS}") + + if(ARG_FORCE_ON) + foreach(F ${ARG_FORCE_ON}) + foreach(V ${MARCH_VARIANTS_DISABLED}) + list(GET V 0 VARIANT) + if (VARIANT STREQUAL F) + list(GET V 1 VARIANT_FLAGS) + list(APPEND VARIANTS "${VARIANT}\;${VARIANT_FLAGS}") + endif() + endforeach() + endforeach() + endif() + + foreach(V ${VARIANTS}) list(GET V 0 VARIANT) list(GET V 1 VARIANT_FLAGS) set(l ${lib}_${VARIANT}) |