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 | |
parent | f4d338f0b44e28d9ad5b446422caf15fd871c8cd (diff) |
build: add FORCE_ON option for multiarch variants
Type: make
Change-Id: I37fb925a9cc2dfc21dd7874f4b20a6943b28efc8
Signed-off-by: Damjan Marion <damarion@cisco.com>
-rw-r--r-- | src/cmake/cpu.cmake | 20 | ||||
-rw-r--r-- | src/cmake/plugin.cmake | 8 | ||||
-rw-r--r-- | src/plugins/avf/CMakeLists.txt | 2 |
3 files changed, 26 insertions, 4 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}) diff --git a/src/cmake/plugin.cmake b/src/cmake/plugin.cmake index 536ae9c318a..8038dfa1981 100644 --- a/src/cmake/plugin.cmake +++ b/src/cmake/plugin.cmake @@ -15,7 +15,7 @@ macro(add_vpp_plugin name) cmake_parse_arguments(PLUGIN "" "LINK_FLAGS;COMPONENT;DEV_COMPONENT" - "SOURCES;API_FILES;MULTIARCH_SOURCES;LINK_LIBRARIES;INSTALL_HEADERS;API_TEST_SOURCES;" + "SOURCES;API_FILES;MULTIARCH_SOURCES;MULTIARCH_FORCE_ON;LINK_LIBRARIES;INSTALL_HEADERS;API_TEST_SOURCES;" ${ARGN} ) set(plugin_name ${name}_plugin) @@ -64,7 +64,11 @@ macro(add_vpp_plugin name) PREFIX "" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/vpp_plugins) if(PLUGIN_MULTIARCH_SOURCES) - vpp_library_set_multiarch_sources(${plugin_name} SOURCES ${PLUGIN_MULTIARCH_SOURCES} DEPENDS ${deps}) + vpp_library_set_multiarch_sources(${plugin_name} + SOURCES ${PLUGIN_MULTIARCH_SOURCES} + DEPENDS ${deps} + FORCE_ON ${PLUGIN_MULTIARCH_FORCE_ON} + ) endif() if(PLUGIN_LINK_LIBRARIES) target_link_libraries(${plugin_name} ${PLUGIN_LINK_LIBRARIES}) diff --git a/src/plugins/avf/CMakeLists.txt b/src/plugins/avf/CMakeLists.txt index 95fde7ceff8..939076a8286 100644 --- a/src/plugins/avf/CMakeLists.txt +++ b/src/plugins/avf/CMakeLists.txt @@ -27,6 +27,8 @@ add_vpp_plugin(avf input.c output.c + MULTIARCH_FORCE_ON trm + API_FILES avf.api |