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