Co-authored-by: aleksandr.vodyanov <aleksandr.vodyanov@avroid.tech> Reviewed-on: https://git.avroid.tech/Conan/conan_build/pulls/12
41 lines
1.6 KiB
Diff
41 lines
1.6 KiB
Diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index e0e25db..c0d9399 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -105,16 +105,28 @@ if(NOT MSVC)
|
|
TARGET_COMPILE_OPTIONS(${ly_lib_name}_neon64 PRIVATE -march=armv8-a+dotprod+i8mm)
|
|
LIST(APPEND ly_lib_parts $<TARGET_OBJECTS:${ly_lib_name}_neon64>)
|
|
|
|
- # Enable AArch64 SVE kernels.
|
|
- ADD_LIBRARY(${ly_lib_name}_sve OBJECT
|
|
- ${ly_src_dir}/row_sve.cc)
|
|
- TARGET_COMPILE_OPTIONS(${ly_lib_name}_sve PRIVATE -march=armv9-a+sve2)
|
|
- LIST(APPEND ly_lib_parts $<TARGET_OBJECTS:${ly_lib_name}_sve>)
|
|
-
|
|
set(OLD_CMAKE_REQURED_FLAGS ${CMAKE_REQUIRED_FLAGS})
|
|
set(OLD_CMAKE_TRY_COMPILE_TARGET_TYPE ${CMAKE_TRY_COMPILE_TARGET_TYPE})
|
|
- set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -march=armv9-a+sme")
|
|
+
|
|
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -march=armv9-a+sve2")
|
|
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
|
|
+ # Check whether the compiler can compile SVE functions; this fails
|
|
+ # with Clang for macOS.
|
|
+ check_c_source_compiles("
|
|
+int main(void) { return 0; }
|
|
+ " CAN_COMPILE_SVE)
|
|
+
|
|
+ if (CAN_COMPILE_SVE)
|
|
+ # Enable AArch64 SVE kernels.
|
|
+ ADD_LIBRARY(${ly_lib_name}_sve OBJECT
|
|
+ ${ly_src_dir}/row_sve.cc)
|
|
+ TARGET_COMPILE_OPTIONS(${ly_lib_name}_sve PRIVATE -march=armv9-a+sve2)
|
|
+ LIST(APPEND ly_lib_parts $<TARGET_OBJECTS:${ly_lib_name}_sve>)
|
|
+ else()
|
|
+ ADD_DEFINITIONS(-DLIBYUV_DISABLE_SVE)
|
|
+ endif()
|
|
+
|
|
+ set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQURED_FLAGS} -march=armv9-a+sme)
|
|
# Check whether the compiler can compile SME functions; this fails
|
|
# with Clang for Windows.
|
|
check_c_source_compiles("
|