summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/cmake/cpu.cmake20
-rw-r--r--src/cmake/plugin.cmake8
-rw-r--r--src/plugins/avf/CMakeLists.txt2
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