From f465d02896ebeb6b0810a5006bf9b6a3756fdf4c Mon Sep 17 00:00:00 2001 From: Mark Horvath Date: Thu, 11 Jan 2024 16:00:13 +0100 Subject: [PATCH] [build] Fix cmake install for the SVE2 lib SVE2 and SME2 cmake variables are harmonized. --- adapters/opencv/CMakeLists.txt | 6 +++--- intrinsiccv/CMakeLists.txt | 16 +++++++++------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/adapters/opencv/CMakeLists.txt b/adapters/opencv/CMakeLists.txt index 1e0c9c271..65a488772 100644 --- a/adapters/opencv/CMakeLists.txt +++ b/adapters/opencv/CMakeLists.txt @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2023 Arm Limited and/or its affiliates +# SPDX-FileCopyrightText: 2023-2024 Arm Limited and/or its affiliates # # SPDX-License-Identifier: Apache-2.0 @@ -37,7 +37,7 @@ if(NOT BUILD_SHARED_LIBS) DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev ) - if(INTRINSICCV_ENABLE_SVE2) + if(INTRINSICCV_BUILD_SVE2) ocv_install_target(intrinsiccv_sve2 EXPORT OpenCVModules ARCHIVE @@ -45,7 +45,7 @@ if(NOT BUILD_SHARED_LIBS) COMPONENT dev ) endif() - if(INTRINSICCV_ENABLE_SME2) + if(INTRINSICCV_BUILD_SME2) ocv_install_target(intrinsiccv_sme2 EXPORT OpenCVModules ARCHIVE diff --git a/intrinsiccv/CMakeLists.txt b/intrinsiccv/CMakeLists.txt index 4eb6ead8b..c341df95d 100644 --- a/intrinsiccv/CMakeLists.txt +++ b/intrinsiccv/CMakeLists.txt @@ -20,10 +20,10 @@ endif() set(INTRINSICCV_BUILD_SVE2 OFF) if (INTRINSICCV_ENABLE_SVE2 OR INTRINSICCV_ENABLE_SVE2_SELECTIVELY) check_cxx_compiler_flag("-march=armv8-a+sve2" INTRINSICCV_COMPILER_SUPPORTS_SVE2) - if (NOT INTRINSICCV_COMPILER_SUPPORTS_SVE2) - message(STATUS "[IntrinsicCV] Compiler does not support SVE2") - else() + if (INTRINSICCV_COMPILER_SUPPORTS_SVE2) set(INTRINSICCV_BUILD_SVE2 ON) + else() + message(STATUS "[IntrinsicCV] Compiler does not support SVE2") endif() endif() @@ -38,8 +38,10 @@ if (INTRINSICCV_COMPILER_SUPPORTS_SME2 AND INTRINSICCV_ENABLE_SME2) check_cxx_compiler_flag("-march=armv9-a+sve2+sme2" INTRINSICCV_COMPILER_SUPPORTS_SME2) endif() -if (NOT INTRINSICCV_COMPILER_SUPPORTS_SME2 AND INTRINSICCV_ENABLE_SME2) - set(INTRINSICCV_ENABLE_SME2 OFF) +set(INTRINSICCV_BUILD_SME2 OFF) +if (INTRINSICCV_COMPILER_SUPPORTS_SME2 AND INTRINSICCV_ENABLE_SME2) + set(INTRINSICCV_BUILD_SME2 ON) +else() message(STATUS "[IntrinsicCV] Compiler does not support SME2") endif() @@ -125,7 +127,7 @@ if(INTRINSICCV_BUILD_SVE2) ) endif() -if(INTRINSICCV_ENABLE_SME2) +if(INTRINSICCV_BUILD_SME2) add_library(intrinsiccv_sme2 OBJECT ${INTRINSICCV_SME2_SOURCES}) target_include_directories(intrinsiccv_sme2 PRIVATE ${INTRINSICCV_INCLUDE_DIRS}) set_target_properties(intrinsiccv_sme2 PROPERTIES CXX_STANDARD 17) @@ -147,7 +149,7 @@ if(INTRINSICCV_BUILD_SVE2) target_link_libraries(intrinsiccv PRIVATE intrinsiccv_sve2) endif() -if(INTRINSICCV_ENABLE_SME2) +if(INTRINSICCV_BUILD_SME2) target_compile_definitions(intrinsiccv PRIVATE INTRINSICCV_HAVE_SME2) target_link_libraries(intrinsiccv PRIVATE intrinsiccv_sme2) endif() -- GitLab