1cc1dc7a3Sopenharmony_ci#  SPDX-License-Identifier: Apache-2.0
2cc1dc7a3Sopenharmony_ci#  ----------------------------------------------------------------------------
3cc1dc7a3Sopenharmony_ci#  Copyright 2020-2023 Arm Limited
4cc1dc7a3Sopenharmony_ci#
5cc1dc7a3Sopenharmony_ci#  Licensed under the Apache License, Version 2.0 (the "License"); you may not
6cc1dc7a3Sopenharmony_ci#  use this file except in compliance with the License. You may obtain a copy
7cc1dc7a3Sopenharmony_ci#  of the License at:
8cc1dc7a3Sopenharmony_ci#
9cc1dc7a3Sopenharmony_ci#      http://www.apache.org/licenses/LICENSE-2.0
10cc1dc7a3Sopenharmony_ci#
11cc1dc7a3Sopenharmony_ci#  Unless required by applicable law or agreed to in writing, software
12cc1dc7a3Sopenharmony_ci#  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13cc1dc7a3Sopenharmony_ci#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14cc1dc7a3Sopenharmony_ci#  License for the specific language governing permissions and limitations
15cc1dc7a3Sopenharmony_ci#  under the License.
16cc1dc7a3Sopenharmony_ci#  ----------------------------------------------------------------------------
17cc1dc7a3Sopenharmony_ci
18cc1dc7a3Sopenharmony_ciset(ASTCENC_ARTIFACTS native none neon avx2 sse4.1 sse2)
19cc1dc7a3Sopenharmony_ciset(ASTCENC_CONFIGS ${ASTCENC_ISA_NATIVE} ${ASTCENC_ISA_NONE} ${ASTCENC_ISA_NEON} ${ASTCENC_ISA_AVX2} ${ASTCENC_ISA_SSE41} ${ASTCENC_ISA_SSE2})
20cc1dc7a3Sopenharmony_cilist(LENGTH ASTCENC_ARTIFACTS ASTCENC_ARTIFACTS_LEN)
21cc1dc7a3Sopenharmony_cimath(EXPR ASTCENC_ARTIFACTS_LEN "${ASTCENC_ARTIFACTS_LEN} - 1")
22cc1dc7a3Sopenharmony_ci
23cc1dc7a3Sopenharmony_ciforeach(INDEX RANGE ${ASTCENC_ARTIFACTS_LEN})
24cc1dc7a3Sopenharmony_ci    list(GET ASTCENC_ARTIFACTS ${INDEX} ASTCENC_ARTIFACT)
25cc1dc7a3Sopenharmony_ci    list(GET ASTCENC_CONFIGS ${INDEX} ASTCENC_CONFIG)
26cc1dc7a3Sopenharmony_ci    if(${ASTCENC_CONFIG})
27cc1dc7a3Sopenharmony_ci        set(ASTCENC_ISA_SIMD ${ASTCENC_ARTIFACT})
28cc1dc7a3Sopenharmony_ci
29cc1dc7a3Sopenharmony_ci        if(${ASTCENC_ISA_SIMD} MATCHES "neon")
30cc1dc7a3Sopenharmony_ci           set(CMAKE_OSX_ARCHITECTURES arm64)
31cc1dc7a3Sopenharmony_ci        elseif(${ASTCENC_ISA_SIMD} MATCHES "avx2")
32cc1dc7a3Sopenharmony_ci           set(CMAKE_OSX_ARCHITECTURES x86_64h)
33cc1dc7a3Sopenharmony_ci        elseif(NOT ${ASTCENC_ISA_SIMD} MATCHES "none")
34cc1dc7a3Sopenharmony_ci           set(CMAKE_OSX_ARCHITECTURES x86_64)
35cc1dc7a3Sopenharmony_ci        endif()
36cc1dc7a3Sopenharmony_ci
37cc1dc7a3Sopenharmony_ci        include(cmake_core.cmake)
38cc1dc7a3Sopenharmony_ci    endif()
39cc1dc7a3Sopenharmony_ciendforeach()
40