diff --git a/CMakeLists.txt b/CMakeLists.txt index cfd0e2591..27520bfff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -193,6 +193,14 @@ aws_set_common_properties(${PROJECT_NAME} NO_WEXTRA) aws_prepare_symbol_visibility_args(${PROJECT_NAME} "AWS_COMMON") target_compile_options(${PROJECT_NAME} PUBLIC ${PLATFORM_CFLAGS}) +if (NOT USE_CPU_EXTENSIONS) + target_compile_definitions(${PROJECT_NAME} PUBLIC -DHAS_CPU_EXTENSTIONS=0) + message(STATUS "Adding -DHAS_CPU_EXTENSTIONS=0 to target ${PROJECT_NAME}") +else () + target_compile_definitions(${PROJECT_NAME} PUBLIC -DHAS_CPU_EXTENSTIONS=1) + message(STATUS "Adding -DHAS_CPU_EXTENSTIONS=1 to target ${PROJECT_NAME}") +endif () + # Check public headers, to ensure they're safe for any 3rdparty to include set(HEADERS_TO_CHECK ${AWS_COMMON_HEADERS}) diff --git a/source/encoding.c b/source/encoding.c index 5b854c014..5027faaca 100644 --- a/source/encoding.c +++ b/source/encoding.c @@ -9,7 +9,7 @@ #include #include -#ifdef USE_SIMD_ENCODING +#if defined(USE_SIMD_ENCODING) && HAS_CPU_EXTENSTIONS size_t aws_common_private_base64_decode_sse41(const unsigned char *in, unsigned char *out, size_t len); void aws_common_private_base64_encode_sse41( const unsigned char *in,