diff --git a/CMakeLists.txt b/CMakeLists.txt index 08d3dc2b..6e860e11 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -224,15 +224,18 @@ if(BUILD_KVAZAAR_BINARY) target_link_libraries(kvazaar-bin PUBLIC kvazaar) endif() +list(APPEND ALLOW_AVX2 "x86_64" "AMD64") + if(MSVC) target_include_directories(kvazaar PUBLIC src/threadwrapper/include) - set_property( SOURCE ${LIB_SOURCES_STRATEGIES_AVX2} APPEND PROPERTY COMPILE_FLAGS "/arch:AVX2" ) + if(${CMAKE_SYSTEM_PROCESSOR} IN_LIST ALLOW_AVX2) + set_property( SOURCE ${LIB_SOURCES_STRATEGIES_AVX2} APPEND PROPERTY COMPILE_FLAGS "/arch:AVX2" ) + endif() else() if(BUILD_KVAZAAR_BINARY) set_target_properties(kvazaar-bin PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src) endif() set_target_properties(kvazaar PROPERTIES SOVERSION "7" VERSION "7.4.0") - list(APPEND ALLOW_AVX2 "x86_64" "AMD64") if(${CMAKE_SYSTEM_PROCESSOR} IN_LIST ALLOW_AVX2) set_property( SOURCE ${LIB_SOURCES_STRATEGIES_AVX2} APPEND PROPERTY COMPILE_FLAGS "-mavx2 -mbmi -mpopcnt -mlzcnt -mbmi2" ) set_property( SOURCE ${LIB_SOURCES_STRATEGIES_SSE41} APPEND PROPERTY COMPILE_FLAGS "-msse4.1" ) diff --git a/src/global.h b/src/global.h index 12f6f6c2..018e8bd5 100644 --- a/src/global.h +++ b/src/global.h @@ -365,7 +365,7 @@ typedef enum { COLOR_Y = 0, COLOR_U, COLOR_V } color_t; # define COMPILE_POWERPC 0 #endif -#if defined (_M_ARM) || defined(__arm__) || defined(__thumb__) +#if defined (_M_ARM) || defined(_M_ARM64) || defined(__arm__) || defined(__thumb__) # define COMPILE_ARM 1 #else # define COMPILE_ARM 0 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2d386f02..eb95bac1 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -15,13 +15,16 @@ if(BUILD_SHARED_LIBS) add_definitions(-DPIC) endif() +list(APPEND ALLOW_AVX2 "x86_64" "AMD64") + if(MSVC) target_include_directories(kvazaar_tests PUBLIC ../src/threadwrapper/include) - set_property( SOURCE ${TEST_SOURCES} APPEND PROPERTY COMPILE_FLAGS "/arch:AVX2" ) + if(${CMAKE_SYSTEM_PROCESSOR} IN_LIST ALLOW_AVX2) + set_property( SOURCE ${TEST_SOURCES} APPEND PROPERTY COMPILE_FLAGS "/arch:AVX2" ) + endif() add_definitions(-DWIN32_LEAN_AND_MEAN -D_WIN32 -DWIN32 -DWIN64) else() - list(APPEND ALLOW_AVX2 "x86_64" "AMD64") if(${CMAKE_SYSTEM_PROCESSOR} IN_LIST ALLOW_AVX2) set_property( SOURCE ${TEST_SOURCES} APPEND PROPERTY COMPILE_FLAGS "-mavx2 -mbmi -mpopcnt -mlzcnt -mbmi2" ) endif()