cmake: introduce WITH_EC_ISA_PLUGIN

instead of checking "HAVE_NASM_X64_AVX2 OR HAVE_ARMV8_SIMD" everywhere,
use a single cached variable of WITH_EC_ISA_PLUGIN. so it's more
consistent when checking the availability of ec_isa plugin.

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2021-04-09 12:14:23 +08:00
parent 3798cc6592
commit bed1b32974
5 changed files with 10 additions and 9 deletions

View File

@ -2753,7 +2753,7 @@ std::vector<Option> get_global_options() {
Option("osd_erasure_code_plugins", Option::TYPE_STR, Option::LEVEL_ADVANCED)
.set_default("jerasure lrc"
#if defined(HAVE_NASM_X64_AVX2) || defined(HAVE_ARMV8_SIMD)
#if defined(WITH_EC_ISA_PLUGIN)
" isa"
#endif
)

View File

@ -23,6 +23,10 @@ add_subdirectory(shec)
add_subdirectory(clay)
if(HAVE_NASM_X64_AVX2 OR HAVE_ARMV8_SIMD)
set(WITH_EC_ISA_PLUGIN TRUE CACHE BOOL "")
endif()
if(WITH_EC_ISA_PLUGIN)
add_subdirectory(isa)
set(EC_ISA_LIB ec_isa)
endif()

View File

@ -250,14 +250,11 @@
/* we have a recent nasm and are x86_64 */
#cmakedefine HAVE_NASM_X64
/* nasm can also build the isa-l:avx2 */
#cmakedefine HAVE_NASM_X64_AVX2
/* nasm can also build the isa-l:avx512 */
#cmakedefine HAVE_NASM_X64_AVX512
/* Define if isa-l is compiled for arm64 */
#cmakedefine HAVE_ARMV8_SIMD
/* Define if the erasure code isa-l plugin is compiled */
#cmakedefine WITH_EC_ISA_PLUGIN
/* Define to 1 if strerror_r returns char *. */
#cmakedefine STRERROR_R_CHAR_P 1

View File

@ -74,7 +74,7 @@ target_link_libraries(unittest_erasure_code_plugin_jerasure
add_dependencies(unittest_erasure_code_plugin_jerasure
ec_jerasure)
if(HAVE_NASM_X64_AVX2 OR HAVE_ARMV8_SIMD)
if(WITH_EC_ISA_PLUGIN)
#unittest_erasure_code_isa
add_executable(unittest_erasure_code_isa
@ -105,7 +105,7 @@ target_link_libraries(unittest_erasure_code_plugin_isa
)
add_dependencies(unittest_erasure_code_plugin_isa
ec_isa)
endif(HAVE_NASM_X64_AVX2 OR HAVE_ARMV8_SIMD)
endif(WITH_EC_ISA_PLUGIN)
# unittest_erasure_code_lrc
add_executable(unittest_erasure_code_lrc

View File

@ -58,7 +58,7 @@ TEST(ErasureCodePlugin, factory)
EXPECT_TRUE(erasure_code.get());
}
}
#ifdef HAVE_NASM_X64_AVX2
#ifdef WITH_EC_ISA_PLUGIN
//check clay plugin with scalar_mds=isa
{
const char *techniques[] = {