diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f30ca8..305c454 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,12 @@ set_target_properties(gmock_main PROPERTIES CXX_CLANG_TIDY "") add_subdirectory(./libs/base64pp) add_subdirectory(./libs/base64-aklomp) + +ADD_SUBDIRECTORY(libs/base64sve/) +INCLUDE_DIRECTORIES(libs/base64sve/lib/include/) +# INCLUDE_DIRECTORIES(libs/base64rvv/lib/include) + + include_directories(libs) aux_source_directory(./src/ CTR_SOURCES) @@ -65,6 +71,9 @@ aux_source_directory(./src/modp_b64_chromium CTR_SOURCES) include_directories(libs/cppcodec) aux_source_directory(./src/cppcodec CTR_SOURCES) +INCLUDE_DIRECTORIES(libs/base64sve/lib/include) +AUX_SOURCE_DIRECTORY(./src/base64sve CTR_SOURCES) + include_directories(libs/boost/utility/include) include_directories(libs/boost/serialization/include) include_directories(libs/boost/config/include) @@ -78,14 +87,11 @@ include_directories(libs/boost/static_assert/include) include_directories(libs/boost/assert/include) aux_source_directory(./src/boost CTR_SOURCES) -add_subdirectory(./libs/base64sve/) -include_directories(libs/base64sve/lib/include) -AUX_SOURCE_DIRECTORY(./src/base64sve CTR_SOURCES) set_source_files_properties( ${CTR_SOURCES} PROPERTIES LANGUAGE CXX ) set_source_files_properties( ${C_SOURCES} PROPERTIES LANGUAGE C ) add_executable(${PROJECT_NAME} ${CTR_SOURCES} ${C_SOURCES}) -target_link_libraries(${PROJECT_NAME} PRIVATE GTest::gtest GTest::gtest_main base64pp base64) +target_link_libraries(${PROJECT_NAME} PRIVATE GTest::gtest GTest::gtest_main base64pp base64 base64sve -static) add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME}) diff --git a/src/base64sve/base64sve.cpp b/src/base64sve/base64sve.cpp index b23bbde..d24f69f 100644 --- a/src/base64sve/base64sve.cpp +++ b/src/base64sve/base64sve.cpp @@ -1,6 +1,7 @@ #include #include "../Base64SurveyRegistry.hpp" #include "base64sve/lib/include/base64sve.h" +#include struct BASE64SVE_Adapt { @@ -21,8 +22,6 @@ struct BASE64SVE_Adapt std::string encoded; encoded.resize(encLen); func((void *)&bytes[0], &encoded[0], bytes.length()); - // void base64_encode(void *input, char *output, size_t length); - return encoded; } @@ -42,12 +41,12 @@ struct base64sve { std::string encode(const std::string &bytes) { - return BASE64SVE_Adapt::encode(base64_encode, bytes); + return BASE64SVE_Adapt::encode(base64sve_encode, bytes); } std::string decode(const std::string &base64) { - return BASE64SVE_Adapt::decode(base64_decode, base64); + return BASE64SVE_Adapt::decode(base64sve_decode, base64); } };